I want a HoP macro that

Casts Hand of Protection on the focus target if there is a friendly focus target, if not, it casts it on my current target if that's friendly.

Then as an option, I might want it either on me or on the targets target if all else fails.

I'm thinking:

/cast [help] [target=focus, help] [target=target, help] Hand of Protection

Is that anywhere near?