Code:

on *:START: {
  if (!%firstrun) {
    set %firstrun $true
    ; first run stuff here.
  }
}



~ Edit ~

You can just add it to an existing START event if you have one.