I understand that you want the script to give player's health back if he's just injured, right?
Put it in a trigger.
Condition: player damage > 0
On activation: player setdammage 0
And type of the trigger should be repeatedly.
Not tested, but it should work that way. I don't know how it works if the player's damage reaches 1. Is he dead then or does this keep him still alive?
Test it.
Where you are going to use this... Hmm...
EDITThe answer to your first question:
?(alive playername): setdammage 0
should be
?(alive player) : player setdammage 0
in a _script_.
But use the trigger method, if you just want to check if player is injured and heal him.