In which case, you've implemented it incorrectly.
Uhm jea I try to make the robot drive and meausures the distance at the same time, but at the moment the robot does one thing after an other.
because you have coded it to do so.
See - your "measurement" state takes (165-15) * 2 * 30msec = 600 * 30 msec = 18 seconds. The delay(30) means the Arduino CANNOT do anyhting ele in that time. Its locked into the measurement state.