Last night I did NOT properly read the modified paren detect code. It looks OK - I withdraw my warning. (The warning about the I/O routines stands - you REALLY should correct those, even if the file is used only once.)
This misreading does not deserve the verbal whipping you handed out.
I don't care about your qualifications, sir. Insulting the very developer responsible for the product you're using and the code you're modifying is never a good idea.