Can't Break From While Loop

I'd move code out of the while loop and use the loop() itself.

Maybe take a look at:

...and consider that you want to measure the distance, set a timer, and control a couple lights based on the distance and timer.