To run R:
Let A be the following steps:
Fire an event named "a".
"a"
If the condition is true, run A.
Otherwise, queue a microtask, given A.