I love the email option. But have you considered setting rules to validate the email upon entry? Make sure that it has the "@" symbol and no commas. etc? That would be attacking the problem from the front end, not in the script itself.
Just wondering if that would give you greater success.
I would still like to know how to detect where an error occurs in a script, but I like your thinking here.
I assume you would go to Manage Database/Options for Field/Validation/Validated by calculation, but I am lost after that.