Heya, help for project coding much appreciated

Not too sure what you're trying to do here - the Sharp IR rangefinders have a nonlinear voltage response as compared to distance. If you give the model number we can give a generic function for converting analog readings to distances. You also only need to read the distance once.

In regards to your original question, something like this should suffice:

void loop() {
  uint16_t reading = analogRead(SHARP_IR_PIN);
  uint8_t distance = adc_to_cm(reading); // you will need to derive this function by measuring various distances and voltages and doing a regression analysis
  if (distance < 20) {
    myservo1.write(90);
  } else {
    myservo1.write(180);
  }
  if (distance < 15) {
    myservo2.write(90);
  } else {
    myservo2.write(0);
  }
}

Servo::writeMicroseconds(int) is a perfectly valid way to write positions to a servo, but is generally unnecessary and inconvenient if you're not using control loops that need the resolution. Servo::write(int) is much better, as it takes a parameter of an angle between 0 and 180 - significantly more intuitive.