There's no inifinite loop in zscripting. The only option is to use a large number of iterations. But be aware that zscripts are only active so long as they are the loaded zscript - pressing another plugin button will dispel the current zscript as only one can be active at one time.