Search the forums for money or scoring scripts, they might help. In the meantime, does this help? Syntax not guaranteed. Check the command ref for more info on the commands - arithmetic functions and the like at at the beginning, before A.
#loop
_score=0
? (getdammage loon1) > 0.5:_score=_score+2
~2
? someVariable:_score=_score-1
? _score<0:exit
? _score>5:goto "win"
goto "loop"
#win
hint "You won!"
~3
endVariable=true
exit