I'm not sure what order ID is to be honest. So maybe that is the problem.
When you cast a spell, you give unit an order which it tries to carry out.
Take Fireball for example. You have a unit with Fireball spell. The spell has 600.00 range. You click the spell's icon and select target which is 800.00 range away.
What does your unit do? It runs towards the target until it is within range, then starts casting the spell until finally it shoots the fiery ball at the target.
How does the game keep track of what to do? Answer: via order.
The moment you selected target of the Fireball spell, the caster was issued an order on a targeted unit. The order (or order ID) is hardcoded into each spell. So in case of Fireball, the order is 'firebolt', in case of Stormbolt, the order is 'stormbolt'. In case of Holy Light the order is 'holybolt'.
Unit has same order until it completely finishes whatever that order entails. In case of Fireball, the order lasts until caster successfully finishes casting the spell.
This way the game knows what your unit is currently doing and what it should do next.
Since these orders are hardcoded, there is no way to change them even if you create derivates of the original spell. So for example lets say I have Paladin with Holy Light and I also give him another ability, based off Holy Light, called Empowered Holy Light. The thing is, both spells have the same order id 'holybolt'. So when the Palading is issued order 'holybolt', which spell should the game choose to use?
That is the "confusion" you are most likely writing about.
The only spell which does not have its order hardcoded is the "Channel" spell, which is the reason why it is used so much - Channel spell has "Data - Base Order ID" which allows you to set which order the spell will use.