Using a 'repeat' or 'while' loop crashes module

Like the title says, if I try and use ‘repeat’ or ‘while’ in my code, my module crashes. I’m trying to delay a snippet of code from running until a variable == true. I was trying to nest these in an ‘IF’ statement but it would crash when I pushed the encoder to run my code. So, I put it into the simplest possible code and it crashes on init.

-- 'System' element 'Setup' page

t1 = 0
timer_start(16, 1000)
repeat
print(t1)
until t1 == 1
print('tock')

-- 'System' element 'Timer' page

t1 = 1
print('tick')
timer_start(16, 1000)
t1 = 0

As soon as you ‘Commit’ the code, the module crashes. I’ve tried with repeat and while.

Both will crash the module. Are these control structures not supported?