There is a /tnick command you can use, which saves you the trouble of setting a temporary nickname as a variable.> /tnick
Changes your nickname to a temporary nickname, without affecting your main or alternate nicknames.This snippet is not muti-server capable without the use of /scon command. Lastly, I'll use $awaytime rather than $idle. You can then calculate how long you've been away once back using:
$duration($awaytime)