If you are familiar with JASS (WC3's map scripting), it's very similar to the model y'all are throwing around, which is basically the correct one to use for this.
In a JASS-like system, for example, Opportunity attack would look something like this...
Opportunity Attack
* Trigger
Move, Ranged...