Stop a void function when another one is running

I didn't post the whole sketch for basically 2 reasons: it's already pretty big even though it's still incomplete, and many parts (functions, comments, etc.) are written in Italian.

You'll admit this makes it difficult for us to understand the rest of your post

--> how do you want us to get what you do...

Now, when i move the magnet away from the immediate reed (void IMM()) the ALL() function is run; so Buzzer, green and red leds are on. But if i move the magnet close to the reed sensor again, the buzzer keeps buzzing but the leds turn off.

Or if ALL() function is running because the immediateREED value was HIGH, and while the alarm is on (so buzzer and LEDs are on) I make the delayedREED value be HIGH as well, the buzzer keeps buzzing but the LEDs start blinking at the same sequences described in the PRE() function.

Both of the issues above happen if I use both "while" and "if".