The code is working the way it is and can also be altered as such:
alias hopall { var %x 0 while $chan(%x) { hop -c $v1 inc %x } }