Raid Target Icon Macro Question

Is there any way to mark something only if it is not currently marked?

I’m using this lightwell macro:

#showtooltip Lightwell
/cast lightwell
/target lightwell
/script SetRaidTarget(“target”, 4);

This is pretty great, except if I use it while targeting already marked targets, it will override their current marks. This tends to be a problem if I have teammates marked and want to drop the lightwell, but don’t want to remove the marks from my teammates.

#showtooltip
/cast lightwell
/target Lightwell
/run if not GetRaidTargetIndex("target") then SetRaidTarget("target", 4) end

Works great, thanks.