Well, the thing about your script, everytime the function runs, anyone with over 20 exp will gain a level.
This is because %lvlexp is set back to 20 whenever it reaches the client.
Where it says %lvlexp = 20; change it to %lvlexp = 20 + 15*(%client.lvl-1));