drawing machine

hi !
we are creating a drawing machine that does mistakes and turns red (LED) after the mistake.
This is the code so far :
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
#include <Servo.h>

Servo servoMain; // Define our Servo
Servo servo2;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
servo2.attach(9);
servoMain.attach(10);
}

// the loop routine runs over and over again forever:
void loop() {
turnRight (); // Turn Servo Left to 45 degrees
delay(3000);
servo2.write(0);
delay(1000);
servo2.write(20);
delay(1000);
digitalWrite(led, LOW); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(led, HIGH); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second

}

void turnRight() {
servoMain.write(180);
}

But right now, the Servomain is doing a circle (this is what we want) and the Servo2 is moving sometimes : it is the mistake. However, we do not now how to make the light on after the mistake for a few seconds and then off again before the next mistake. Also, what would be awesome is if we could have the mistake randomly.
Thanks for your help !

Actually the new code : we try to use While but there is the message :

sketch_jun18a.ino: In function 'void loop()':
sketch_jun18a:37: error: 'position' was not declared in this scope
'position' was not declared in this scope

and we don't know how to correct it

/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
#include <Servo.h>
int pos = 0;
Servo servoMain; // Define our Servo
Servo servo2;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
servo2.attach(9);
servoMain.attach(10);
}

// the loop routine runs over and over again forever:
void loop() {
servoMain.write(7000); // Turn Servo Left to 45 degrees
delay(1000);
servoMain.write(0);
delay(1000);
servo2.write(0);
delay(1000);
servo2.write(20);
delay(1000);

while(servo2 (position< 20)){
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
}
}

  1. In future please use code tags.

  2. What do you expect the following code to do?

while(servo2 (position< 20)){