You can just use on TEXT for PRIVMSG. mIRC supports a lot of standard irc commands and messages with own event handlers. For those, the raw message isn't triggered afaik.
CTCP stuff also has it's own event handler, see /help CTCP Events
ctcp <level>:<matchtext>:<*|#|?>:<commands>