run and repeat code until button is pressed with IR remote

OP tried :wink: see the square brackets in front and after the code

OP

Replace [ in the beginning by [code]
Replace ] at the end by [/code]