"The raw event allows you to process numeric server messages that are identified only by a number, and non-numeric server messages which mIRC doesn't recognize internally."

taken from /help raw events, pay special attention to the last part. so for messages, you have to work with the on text event.

as side note, you can make /debug send everything to an alias, see /help /debug

wiebe