The macro is working just as it should do according to the use of the spell.

It first try to heal you're target and work if it is friendly,however if it is not friendly a heal automatically default to heal yourself,so it skip the last line since it don't reach it.



A way around is to use the focus setting or under certain condition if you are using a mouse to play with the mousehover settings

to set a focus do shift+F or make a macro with /focustarget

/Macroicon cure
/ac cure <f>
/ac cure <t>
(Will cast cure on focus,if none is set will cast on target if friendly or on you if unfriendly)

/Macroicon cure
/ac cure <mo>
/ac cure <t>
(will cast cure on current mousehover if friendly or on you if unfriendly,if no mousehover will cast on target if friendly or on you if unfriendly)

/Macroicon cure
/ac cure <mo>
/ac cure <f>
/ac cure <t>
(will cast cure on current mousehover if friendly or on you if unfriendly,if no mousehover will cast on focus,if none is set will cast on target if friendly or on you if unfriendly)