Umm, you pasted the orderTargetLib twice. :)
Why do you repeat this section twice, once outside the if blocks and once inside?
set OrderTarget[.n].x = GetUnitX(GetTriggerUnit())
set OrderTarget[.n].y = GetUnitY(GetTriggerUnit())
call MoveLocation(.loc, OrderTarget[.n].x, OrderTarget[.n].y)
set OrderTarget[.n].z = GetLocationZ(.loc) + GetUnitFlyHeight(GetTriggerUnit())
To avoid confusion, perhaps you should name the initialization method something other than create, like get, init or whatever.
This has the potential to keep a lot of handle indexes hostage, perhaps you should make the number of instances calibratable so performance oriented people who know what they're doing can choose a number lower than 8191.