on *:CHAT:Closing Idle connection in 30 seconds*:msg =$nick Anti-Idle

That will work on some, but some have what's called Anti-Camp,
which will close the session anyway unless you type an actual
command, or you can try this one

on *:CHAT:Closing Idle connection in 30 seconds*:msg =$nick help