Just cleaning up your macros a bit... "target=target" etc burns my eyes.
Code:
#showtooltip
/cast [@mouseover, help, nodead][@player] Word of Glory
would do what you want:
-heal your mouseover if it's friendly and alive
-heal yourself if you don't have a friendly alive mouseover.
It does not include a way to heal your target though, though if that is desired, it can be done easily. On my healers, I always used a macro that had a mouseover condition like above, if there was no mouseover it heals my target, if that target isn't friendly (or I press alt) it heals myself (if I press alt it heals myself in any case). That would be:
Code:
#showtooltip
/cast [@mouseover, help, nodead, nomod:alt][nomod:alt, help, nodead][@player] Word of Glory