You have to either set a timer and watch for an away message in the channel, or else set a timer and check their /whois response for an away status. Personally, idlers don't bother me, but if they bother you, then just do that.
Keep in mind that someone reconnecting and rejoining your channel while they were already away would also trigger any script you wrote unless you also set a timer everytime someone parted or quit and make you script not trigger if they return within 5 minutes or so.