Couple ways (without copying the sequence repeatedly):
Batch files can use Labels. If you put a "Start:" (no quotes, see the colon) at the top, for example, you can then say "goto start" at the end and it'll loop till you kill it.
******
If you want to do iterative subsitution (loop with different values each time):
For %%1 in (Val1 Val2 Val3...etc) DO
...the stuff you want to do goes here, the %%variables are replaced with the current value from the sub list at the top
Loop
*********
and to do a conditional ...
if %%1 = "Whatevervaluegoeshere" then goto (your label to the exit routine here, no parens)
I may be off on some of the finer details (like whether you'd have to say goto Start or start🙂, but if you play in this neighborhood, you should be able to get it together.
Good Luck
Scott