Magnetic switch loop

I think i got meaning of BECOMES and IS LOW

Then implement it in your code.

but seems I cannot stop the loop

That is correct.

so my box keep playing sound when it is open, why?

Read through the code and you will see there is nothing you do to stop it.

While you are at it read the how to use the forum sticky so you can post your code correctly.