Yes, declare a variable for every nick on join event to a matching $address($nick,N). Then, if the user joins with a different nick but same host, loop for all the variables with the same matching $address($nick,N), then if the nick of the variable is different, echo it for the on join.
And then there should be alternate methods like hash tables and such.
The problem is, how long do you want mIRC to store every nick and host? For example, if you stored it for 30 seconds, then someone part/joining on a new nick, within 30 seconds, your mIRC can detect. And what would be the point for storing them forever.