Oh, I think you would love automated testing.
Automated testing is largely about logic errors. Since the code is executed, it must of course be parsed, and so you essentially get syntax error checking for free too.
I often find most of my errors by just playing and replaying the game...
This is exactly what automated testing helps to reduce. At a broad level, you could write tests that essentially script a part of play, and verify expected outputs. At a more detailed level, you can exercise specific functions, without having to go through the trouble of playing the game to get to a point where that function is called. It cuts down drastically on the time and repetition involved in testing. When refactoring code, an automated test can tell you if you've broken something in a fraction of a second.
Better yet, if you do local JavaScript development (which I realize you're not doing here), you can setup a file system watcher that knows to rerun your tests each time you save changes to your JavaScript file. You make a change, save it, and see the tests run in a window off to the side, with color coded red/green output depending on the test results.
As for how to test your code, I may need to think further about it. I was just taking a scroll through your updated code. It seems to be stored in an XML file, with the JavaScript in sub tags. That's a slight complication for testing, since it's not just a raw JavaScript file, so it can't just be included by the test code. Might need some kind of pre-processing step to extract the code into plain JavaScript files, and then run it through tests. This is probably not too difficult to do using an XML library, and it would be able to sort each block of code into its own function or file for testing.