ScriptCode: fix stack depth precondition and add preproccessor directive checking...