For self-healing, I don't bother with modifiers. Here is an example macro:
/cast [@mouseover,exists,help] Renew; [@player] Renew
This casts Renew on my mouseover if it exists and it is friendly. Otherwise it casts Renew on me. The only danger is that you're cursor just happens to be on...