I find the best way to do this is to have 2 variables, one is your score, one is to track lives we'll call it score2.
As you gain points add them to both variables.
When score2 greater or equal to 30,000, add 1 to lives, subtract 30,000 from score2.
The subtract resolves any remainder issues if it creeps over 30,000 say 30,500, score2 would then become 500.