Help Programming MBLOCK Robot?

The first while loop spins the robot until it sees the object. The second while loop is the one that runs the motors to move forward while the object distance is between 80 and 20 cm from the sensor.

Yes, but you have no loop to control any action between 80 and 100cm. So the robot is simply doing nothing and waits forever because no condition will change as long as it's not moving.