see /help ON LOGON, you can hook into the connection process before mIRC sends out user info.
Just as a note by the way, you mentioned something about how mIRC should differentiate a variable from punctuation because it's "not alphanumeric". There is no rule that variables are only made up of alphanumeric characters. In reality, any of the 255 characters except $chr(32) and a few other specials can be used in a variable name: //set %x $+ $chr(9) xyz | echo -a $($+(%,x,$chr(9)),2) (chr9 is the tab character by the way) -- there is no way for mIRC to differentiate in this case.