I haven't really done macros in vanilla yet and I haven't tested this out 
  
Here is how I think you could change the overhealing macro to mouseover: 
/run if UnitExists("mouseover") and UnitIsFriend("player","mouseover") then TargetUnit("mouseover") then CastSpellByName("Flash of Light"); if (UnitHealth('target')/UnitHealthMax('target')>0.95) then SpellStopCasting() end