You might try the Sanity UDF, which will catch most mismatched single & double quotes and parens.
The easiest way to run the Sanity tool is to download the KixDev package from my web site. This ZIP file includes many UDFs, as well as the KGEN tool. Put the 2 KGEN Scripts and Kix32.exe in a folder (you can skip kix32 if it is available via your PATH.) Put a copy of your script into that folder and rename it to a .txt extension (ie - test.txt). Run KGEN TEST (or whatever the name of your script file is, without the .txt extension). KGEN will display any warnings detected by parsing your script file, including undeclared args, duplicate arg definitions (local + global), and args declared but not referenced, in addition to the quote and paren matching.
Of course, the big advantage of KGEN is that if you copy all your UDF files to a folder and reference that folder in the KixLibPath environment variable, KGEN will figure out which UDF files are needed by your project, and automatically generate a .KIX file from your base script and all needed UDFs. (That's why it starts with a .txt file.)
There will also be some log files generated in that folder, reporting the errors, variable usage, etc.
Glenn
_________________________
Actually I
am a Rocket Scientist!