Motor Driver(MDS40A) and MaxBotix(LV EZ-1) Sensor

Once you enter the while loop, you never touch cm again so if it's less than 70 at that point, your code will never exit the motor function.