You can simply use OnActivate:
if ( OnActivate == 1 ) Activate ; Do something else.endif
Or, you can introduce a short variable that gets set to a specific value in the NPC's unique high level greeting (from dialog). You can use the results box of the greeting to perform script tasks too.