If you write M99 instead of M30 at the end of your program, that it’ll run until you’ll stop it.
If you want it to be repeated 30 times, you may declare it with parameters.
The second method is with M97. You have to put your program into a subprogram and then write:
M97P1L30 (call subprogram1, repeat 30 times)
Greetings