You're recieving a server notice, so you wouldn't be able to use the $nick identifier. therefore
on 1:SNOTICE:*is doing a whois on you*:{ set %temp12343 $nick | //echo [ %temp12343 - has performed a /whois on you. ] }
wouldn't work.
I'm not sure if this work's but try.
on *:SNOTICE:*is doing a whois on you*: //echo [ $+ $$1 - has performed a whois on you ]
if that doesn't work, look at your server notice, and count how many words in the nickname doing the whois is in.