There's a Sanity() UDF that helps with this kind of checking - just write a simple script to ask for the name of the file to check, pass that name to Sanity() and it will perform the following checks:
* Generate list of Declared VarNames - Global, Main, & per UDF
* Identify VarNames declared by both DIM and GLOBAL
* Identify VarNames that were not declared
* Identify VarNamed Declared but not used
* Identify suspected use of Vars or Macros in strings
* Identify suspected mismatched single & double quotes
* Identify suspected mismatched parens
* Identify suspected mismatched If/EndIf statements
* Identify suspected mismatched While/Loop statements
* Identify suspected mismatched Do/Until statements
* Identify suspected mismatched For/Next statements
* Identify suspected mismatched Select/EndSelect statements

It creates three files:
VarInfo.ini listing of vars by function
Warnings.csv CSV format listing of generated warnings
codemap.txt A Map of the structure of the script w/ warnings about unbalanced If, While, Do, For, and Select statements
_________________________
Actually I am a Rocket Scientist! \:D