After a wait, it will continue running actions and remaining sub-events. So in the second case you set the variable to 1, then immediately compare it to 1.
In the first case you set the variable to 1 after a wait, then the next tick the variable resets, and it compares it to 1.