You could try something like this:
every 15 minutes:
loop all players:
if "%region at loop-player%" contains "afk":
broadcast "&7All the players in the AFK area have got a reward!"
play sound "entity.experience_orb.pickup" with volume 3 to all players
give white dye named "&5EPIC Crate voucher" to loop-player