Ok, 1. You are making infinite loops. This is not good practice, because if for some reason the car/peds didn't spawn, your GTA IV would freeze. Instead of
for (int i = 0; i < 600; i++)
if (!Game.Exists(ambulance)) break;
} //will wait for 3 seconds (600 x 5 = 3000)
2. Try and single out the problem. Comment out bits of code (like everything except for the spawn ambulance code), then try the code. If it crashes, then it is the part that you didn't comment. If it doesn't crash, then un-comment the next part (like the spawn ped part) and then comment the last part.