Guys, you really can't "debug" the PLC script like a macro. Why? Because the PLC script is only part of a larger script. If you do Operator->Lau Script, you will see ALL of the screen scripts merged together. What you will find is that testcount is declared in the screen load script.
The reason all of the various scripts are merged together is so that each script can access these global variables. The scripts are all merged to form one "LUA chunk".
So to debug the PLC script, one can do Operator->Lau Script, copy the contents, and then past the whole script into the mcLuaEditor. Then, at the bottom, insert a line that calls the PLC script function.
Steve