Like LukeW said... Make an event simply adds 1 to a "idletime" variable every second. Have another event that conditions to idletime>=(time in sec you want) then action out to whatever animation you want.
In your movement events simply add a set idletime=0 after each use.
What will happen is the first event will always try to count idletime up while any movement will always reset it to 0. The second condition will be constantly testing if idletime is greater or equal to your sleep time you decided. As soon as it does that event will trigger whatever sleep junk/animations you action out from the event.