You'll have to provide the nickname (Change "NICK").
To use it in a pop up, you can do it like this
menu nicklist {
test_popup: echo -a $$1 $+'s Idle time is $duration($nick(#,$$1).idle)
}
That will give the idle time of the person in the active channel.
If you want to get their idle time in the server, you can whois them (/whois nickname nickname) then RAW 317 will give you the idle time.