Documentation says that wait cursor states work as stack. Every 'on' call should have matching 'off' call. If you try to set state to 'off' without previously setting it to 'on' you'll cause state stack underflow which in most programming languages throws an exception. If exception is not caught the program will terminate.
global proc errorProc(string $sError) { catch( waitCursor -state off ); error $sError; } errorProc("It's jacked, man.");
Btw, uncaught exception was probably the reason why script terminated at 'objectType' query in your previous brokenness thread.
When you issue the objectType command for non-existent or multiple same-named objects, the command just throws without printing any errors ( they probably didn't finished implementing the regular error handling functionality )
You can always try to catch exceptions on problematic commands. Catch will return 1 if the statement has thrown an exception.
if( catch( problematicCommand ) ){ // inspect and remedy the situation here } // continue normal code flow