Need help with code for 4wd autonomous car.

how should the code be to integrate the IR-sensors in the system?

Obviously different. You FAILed to tell us where the sensors are connected, so we can't write the code for you, to read the sensors.

    delay(2.5);                       // waits 2ms for the servo to reach the position

RTFM!

Your current code makes the car drive forward BLINDLY for periods of time. You will NEVER get complete control, and decent obstacle avoidance, blindfolded.

GET RID OF EVERY delay() in your code.