Making vehicle stop in front of wall using stepper motor and ultrasonic (HELP)

As people have explained a few times already, pulseIn() is blocking. The execution of your code will halt until that command has finished, and it will only finish after either a pulse is detected, or 3 minutes have elapsed. Then your robot stepper may move 1 step, and it will wait for 3 minutes again if the senor isnt detecting anything. You need to read the sensor in a non blocking way, or you could try using interrupts.

BTW, I cant shake the feeling you're asking us to your homework (homework that may be designed specifically to test or improve your ability to use interrupts or write non blocking software). Am I wrong?