You need to create 2 scenes, one to turn off and the other to turn on your lamp.
Then, in each scene you must retrieve the last state of your lamp and, as you indicated, use a « continue » action and only if…
What I don’t understand is how it works, because how does your trigger know whether it should use scene one or two to perform your action of turning on the lamp, for example, since Gladys will try to execute both — there’s no priority
If it turns it on, why doesn’t the other scene turn it off immediately then?
I don’t know the details of how scenes are managed, but since they start from the same trigger the two scenes can run in parallel (to be confirmed by @pierre-gilles) as there is a « continue » action and only then one scene continues but not the other.
At my home these scenes worked for more than a year, but after changing the Zigbee hub it must be more sensitive: if the light was on it would turn off and then turn back on, or vice versa. I spent a week trying to change this behavior. In the end I installed one push-button to turn it on and another to turn it off.