Beware... NetSuite has changed the way you are allowed to access a SuiteScript parameter with version 2007.
Where we used to do something like this in version 11.x:
if ((typeof custscript_case_debug != "undefined") && (custscript_case_debug == 'T')) {
debug = true;
nlapiLogExecution ('DEBUG', 'Debug mode is turned on');
}