Glancing at your program, one big problem that I see is this code:
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
You have the delay function blocking for two seconds in that code, which means the rest of the code doesn't get to run during that time. Try removing that code and see if the program works. If you want to flash an LED at a constant time interval, then you'll need to do it the same way the debugOutput() function works (check how much time has elapsed, and based on that toggle the LED).
Also with the original code if I wanted to add a stop sequence before the robot turns after reading the distance sensor and turning left will this work?
Yep, that would work perfectly. Just keep in mind that the delay() function is "blocking," which means none of the code elsewhere in the program is run until the delay() function is done executing. In this case, if you just want to make the robot stop and do nothing for five seconds, then it will work fine.
the only problem is when I have tried stopping the servo's in the past one still turns? it's like discharging voltage still or its receiving voltage from somewhere else (because it turns really slow).
The servo that is still turning when you set it to neutral (sending it 90) needs to be tuned. If you look at the side of the servo you will see a small hole with a screw inside it. When the servo is set to neutral, slowly turn the screw until it stops moving.
Sorry to keep bombarding you with questions!
No problem! It will take some effort, but I'm sure you can get this working over the next two weeks if you're willing to put time into debugging the program. As I mentioned before, the best way to debug an Arduino program is to put Serial.println() statements in strategic places so that you can read the output in the serial monitor and see exactly how the program is executing.