If the notice is sent to you, $nick will be filled in the on notice event, if the notice is sent to a channel, $chan will be filled.
If you get a notice from an user and you want to display the notice in all the channel you have in common with the user, check $comchan


#mircscripting @ irc.swiftirc.net == the best mIRC help channel