That will not work because even triggered orders are detected by issue order events. Besides, triggering player is simply the owner of the unit being issued an order, not the player issuing an order.
I am trying to achieve an priority system for orders in the following scheme:
Implementing a way to seperate in-system orders from user- or trigger-issued orders; preferrably a priority system; this way, you can basicly have a "basic" AI even on user-controlled units (like autocasting certain spells) without it interferring with user-issued orders; an ideal priority system needs at least 3 layers:
low priority) takes precedence only over "idle" state of units; but has lower priority than user-issued orders (i.e. auto-cast of spells) ... all AI-issued orders should go into this layer by default.
user priority) takes precedence over low priority orders; user-issued orders (or triggered orders outside of programs) should go into this layer by default. If a user priority order is in place, low priority orders will not be issued.
top priority) takes precedence over user-priority orders; this is useful for example if you want to code a confusion or mind-control AI; or a morale system for units or anything that makes the user lose control over the unit.