You might want to use the $duration()
$duration($nick($chan(%x),$me).idle)
so it gives you the mins and secs instead of a range of numbers. Other than that, nice job.