TL : DR - Can't be done.There is a very limited set of conditions which you're allowed to check for when casting spells. These are listed in their entirety in the Complete Macro Guide sticky on this forum. Since the questions are asked so frequently, though, here are some conditions you are not allowed to check for:
- Presence of a (de)buff
- Whether a unit is a player or NPC
- Whether a unit is some other unit (e.g., whether you are targeting yourself)
Best you could get is a modifier macro.
/cast [nomod] Hand of Protection; [mod:alt] Hand of Salvation