Autodesk Developer Network members (see the topic Developer Support) have access to a debug version of the 3ds Max SDK and a special build of 3ds Max in that is compiled in debug mode.
This special version of 3ds Max has a Debug menu available that can be added with the Customize User Interface dialog. This menu provides options to review the 3ds Max command stack to see what is the current command mode and what modes have been previously pushed.
The Autodesk Developer Network has more information about obtaining and using this version of the 3ds Max SDK.