Yes, because both subevents are consecutively true.
Consider logged = 0
Your first subevent happens and so sets logged to 1.
Than right away, you test if logged = 1. It is, since you changed it in the previous subevent.
So it switches back to 0.
What you need is to add a global and/or local variable.
You test it along the value of logged.
Something like :
Logged = 0
Var = 0
-> Set var = 1
-> Set logged = 1
Logged = 1
Var = 0
-> Set var = 1
-> Set logged = 0
This way, you are sure that if a subevent was already ran, the second won't be running as var won't be equal to 0.
You also have a conditionnal expression
On button clicked
-> set logged "logged=0?1:0"