This is a common issue among new users. Basically what's happening is the first event runs and sets the music to 0. But the second event will also run (afterwards), see that the music is 0, and then set it to 1.
So both events are technically running correctly.
There are a lot of ways to handle this. For simplicity, I suggest breaking it into two parts in a single event:
1: On M pressed, set music to 1-music. (this way 1 becomes 0, and 0 becomes 1)
2: If music = 1, do "enable actions". Else, do "disable actions"