so let us do each scenario first and then think about how and whether we want to combine those macros:
/cast [@target,harm,nodead][@mouseover] Avenger's Shield //casts Avenger’s Shield on your target if shift is pressed, otherwise on your mouseovertarget
/cast [mod:shift,@target,harm,nodead][@mouseover,harm,nodead] Judgement //casts Judgement on your target if shift is pressed, otherwise on your mouseover target
/cast [mod:ctrl,@player] Light of the Protector //casts Light of the Protector on yourself if Ctrl is pressed
/cast [mod:alt,@player][@mouseover,help,nodead] Flash of Light //casts Flash of Light on the player if alt is pressed, otherwise on a friendly mouseover target
Now, what is not possible?
You cannot combine 1 and 2. The reason is that you have 2 “otherwise” (else) conditions which cannot be distinguished and you cannot execute two casts at the same time due to the GCD (Global Cooldown).
You cannot check whether your target is hostile and then cast on something else, therefore 4 does not work for the “alt”-condition. However, if you cast Flash of Light without any macro and you have a hostile target FoL will be automatically casted on you so there is no need to do that.
What can we combine?
In general, 3 can be added to any macro, using a semicolon separator
It would be possible to add the mouseover functionality for FoL since you can distinguish between a friendly and a hostile mouseover target
The same goes for the “shift”-condition of 2. We can use this condition to allow you to use judgement on your target if you press shift.
We can fully integrate 4
So here is an untested first attempt to include as many functionalities as possible:
/cast [mod:shift,@target,harm,nodead] Judgement; [mod:ctrl,@player] Light of the Protector; [mod:alt,@player][@mouseover,help,nodead] Flash of Light; [@target,harm,nodead][@mouseover,harm,nodead] Avenger's Shield
So, if I did this right out of my head this macro will:
cast Judgement on your target if you press Shift+Key
cast Light of the Protector if you press Ctrl+Key
cast Flash of Light on you if you press Alt+Key
cast Flash of Light on your mouseover target, if it is friendly
cast Avenger’s Shield on your target if it is hostile
If none of those conditions are true and your mouseover target is hostile, Avenger’s shield is casted on it
In theory this should work but I just hastily wrote it down here. So, a lot can be done but not everything. Therefore either consider using multiple macros and binds or try the macro above. Maybe you could try to use everything except Judgement in the macro and use another key for your judgement macro for example.