Detecting stack imbalance for P/Invokes can be easily done.
Basically, check for ESP/RSP (32/64bit) at transition to native and transition from native.
If the register differs at entry and exit, then the stack is imbalanced.
Easily doable for CorDebug, we need support from the Runtime team for accessing the Register Set of a thread.
Info is taken from here: http://dotnet.dzone.com/news/pinvoke-stack-imbalance-mda