Actually, it seems to break with the added ^.
ah, that's interesting. apparently the difference between including the ^ prefix is that on ^TABCOMP will only trigger if there is a completion to be made. without the ^ prefix, it will trigger on any tab press, which is what this snippet relies on.
about preserving cycling, given that your script only concerns itself with instances where there is nothing to be completed, you can use the fact that on ^TABCOMP triggers only when there IS something to be completed:
on ^*:tabcomp:#:{ set %tabcomp 1 }
on *:tabcomp:#:{
if (!%tabcomp) {
; your script
}
unset %tabcomp
}
a bit hacky but i can't think of a better way ;P