You don't have to /unset when you only use /var. Also,
if ($0 == 0) { halt }
The on input event can't trigger if $0 is 0, so the line isn't needed.