http://www.wowwiki.com/Complex_heal_macro_notes

/script if (UnitName("target") ~=nil and UnitIsFriend("player","target")) then CastSpellByName("Healing Touch(Rank 9)") SendChatMessage("Healing %T", "Party") else TargetUnit("player") CastSpellByName("Healing Touch(Rank 9)") TargetLastEnemy(); end

You should be able to do as you want by modifying the above.

Something like:

/script if UnitName("target") =yurname then ... else castspellbyname

Anyway this is the key:

http://www.wowwiki.com/Talk:API_UnitName