I'm not quite sure what you're getting at... if you want the rocket to reach a height greater than 1,000,000 and have a limit of 50 in Scratch then surely you need to recalculate the steps so the 50 Scratch units matches your yMax
The other easy solution is having a simple: if(rocket.Y > yMax) Then rocket.Y = yMax... that would stop it disappearing, but will also stop moving
Not sure if either are massively helpful suggestions