Does the orb work if the attack is not manually ordered?
No, it won't, you have to add a chainlightning to the tower then make a trigger:
Event: Unit is attacked
Cond: Attacking unit == your tower
Act: Order your tower to chain lightning attacked unit