I believe what you want is a script to do something like /iwhois 127.0.0.1 and have it do a /whois on all users on that IP? something like this would work
alias iwhois { if ($1) { %iw.ip = $1 | .who $1 } }
raw 352:*:{ if (%iw.ip) { .whois $6 $6 } }
raw 315:*:{ unset %iw.ip }
didnt test that code, and if you dont have oper on the network you might need a script that checks the ial instead.