One of the simplest ways is to use groups (/help groups) with /enable and /disable.
Example:
#mygroup on
on *:TEXT:*:#: {
.disable #mygroup
.timer 1 5 .enable #mygroup
; do your event stuff here
}
#mygroup end
You can do the same with a %variable that gets unset after a certain amount of time (see /set -uN) and an if guard:
on *:TEXT:*:#: {
if (%mygroup_disabled) return
set -u5 %mygroup_disabled $true
; do your event stuff here
}