I was working on a script that I will hopefully post to the site in the next few days. Tonight I came back to it and it was giving me a syntax error on line 56. Looked at the line and it looked fine, tried it again and the same thing. So I commented out the line and still got the error on line 56. Changed some code and moved the line and the error was still on 56. Then I remembered, I had several dialogs and each of those dialogs has hidden code, so line 56 that it was showing me in the IDEAScript editor isn't actually line 56 it is some other line (yes the editor can be very dumb). I then opened the script in Netbeans, another IDE I use and looked at line 56 and realized that it was for a dialog that I was no longer using so that was the problem. Deleted the dialog and the script ran fine.
So the moral of the story is to never believe the editor when it gives you a syntax error, especially when you have dialogs.