If the script is in the field's validate event then all you should have to do is change event.value to this.rawValue and it should work. If not I'll take a closer look.
I copy/pasted the script you list above and it works fine, I didn't change anything except to remove the line break in the string in messageBox() (which was probably added by the forum software).
The error messages list errors in three different events, mouseExit, exit, and validate. So what are the exact scripts you have in each of those events?