Soo.. where is the problem? You've got everything you need already in your text. Just use the numbers as conditions to determine which symbol you wanna display.
a condition could look like
totalscore greater or equal 4000: create rank s
totalscore greater or equal 3000 AND totalscore less than 4000: create rank a
or a shorter solution:
When you display the score layout:
create rank (sprite with c, b, etc in frames 1, 2, ..., 0 is empty)
set totalscore = score*numberitems/healthlost
set localvar = floor(totalscore/1000)
- localvar > 4 : set rank frame number = 4
- else: set rank frame number = localvar
or if you wanna use animations:
- localvar > 4 : set rank animation = "a4"
- else: set rank animation = "a"&str(localvar)