your example doesn't check idle time, only if he has done /away or not.. you could change nickname based on /away using an on raw that the server sends to confirm you are set as away instead of checking with a timer. also the ' in your example isnt a valid character for nicks

i put the timer as 30 seconds in my example because it seems like a waste of resources to check every second just to decide if your nick needs `away on it or not.