Somebody can convert this old macro please?

Hi all this macro I had was awesome and would be great if it could be made to work in classic if somebody could help please?
Here is the macro…
/run if not UnitExists(“target”) or UnitIsDead(“target”) or UnitIsFriend(“player”,“target”) then TargetNearestEnemy() end
/run if UnitManaMax > 120 then cast(“Viper Sting”) else cast(“Serpent Sting”) end

What it did was cast viper sting on mana users if not a mana user it would cast serpent sting!
Thanks and I hope it is possible

I thought I answered this in the Discord, but basically the first line can be converted to target enemy no dead line. And the other line is no longer possible within the WoW API.

Just use a modifier to set a sting as default and hold for another sting on modifier.