The difficulty will be getting all matches including when punctuation is attached to the nick. If you just wanted to match when an entire "word" is the nick and not including punctuation, you can use $istok.
if ($istok($1-,$me,32)) { do this }
That will match whole words for the entire line (no need to match against $1, $2, $3, etc). It will not match when punctuation is attached to the nick. The best way to do that kind of match would be regex, I think. If you didn't want to use regex, then you could always $remove all punctuation before the $istok...
var %text = $remove($1-,.,!,$chr(44),",',;,:)
if ($istok(%text,$me,32)) { do this }
$chr(44) is a comma. You can add more punctuation to remove as well. Certain characters need to be in $chr() format because mIRC will think they are part of the command rather than something you're trying to remove, such as the comma.
I'll let someone else show a regex pattern to use. I'm just figuring regex out, so it would take too much effort right now for me to get a valid regex pattern for this myself.