In pixelshox the javscript node could have it's outputs fed back into
it's inputs and it could read the time and initialise variables when
first executed.
You can still do that and no need to connect the outputs back to the
inputs. Just use some supplementary outputs as global variables.
Note that you're not really supposed to build a state machine inside
Quartz Composer though, but the sake of the explanation...
To detect first execution, it's trickier though: you can use an input
that is connected to a Stop Watch and check for time == 0. Note that
you cannot theoretically use Patch Time as there's no guarantee the
first frame rendered will be at time 0.