There's an actual "Script..." event command on Page 3, which is what you'd use. Then just run a Conditional Branch based on the switch you set.
Or you can try to enter it all as "one line" (or break it up into multiple commands using semicolons ( ; ) inside a Conditional Branch condition, as Heretic suggested, if you can get your whole thing to evaluate to true or false.