I have never attempted to halt it, i personally would use something like:
alias example {
if ($hget(filter,0).item) hfree filter
hadd -m filter limit $1
filter -fk temp.txt example.filter.alias *
}
alias -l example.filter.alias {
hinc -m filter climit
if ($hget(filter,limit) <= $hget(filter,climit)) return
/*
..take_what_ever_action..
*/
}
If you can specify this directly to the /limit command you don't have the overhead of calling an alias repeatingly nor the overhead of writing more to the output buffer then is needed, saving quite some time.
What i was trying to say is that sorting should have higher precedence then limiting. So that it wont sort the N limited matches but returns the N limited lines from the sorted input buffer.