You can use a timer.

.timer 1 0 <command> will be triggered right after the event.