Well, that should indeed work, you would find the whois output either in status window, or (if you have 'Show whois in active' checked in Options|IRC) in the channel you clicked the nick.
If you do have "Show whois in active" selected, this entry (in Options / Mouse / Nicklist) would put the output to the query window
- query $$1 | .timer 1 0 editbox -n $1 /whois $1