Syntax errors in scripts are hard to find. The script gets disabled. I found that copying the script to the clipboard and pasting it into the scripting console will display syntax errors fairly close to the offending line. You can then use the interactive syntax checking to find and correct the problem.
This does not help with debugging, still need to use System.out.println()