Eh, I've done it before.
You can't change the orderid of a spell. When you make a custom spell, it gets a new four-letter code, like A001 instead of AOfs, but that's not the orderid, and that's not what the order functions use.
And the spells that can target units are the only ones available to select in the Targeting a Unit order list, spells that can target a point are the only ones available in Targeting a Point, and spells with no target are the only ones available in the No Target order list. So there shouldn't ever be any illegal spells being ordered.
evilprotoss, use "copy as text" on your complete trigger and paste it here. There could be any of a billion things wrong with it.