Error in code expected unqualified-id before '{' token

Hi

I have the following error coming up on my code and cannot find the solution, any help would be very much appreciated
error is "expected unqualified-id before '{' token", this appears after the following line of code
while (Serial.available());
Full program shown below

const int A1_PIN = 7;
const int A2_PIN = 6;

const int A3_PIN = 4;
const int A4_PIN = 3;
const int trigPin = 9;
const int echoPin = 10;
long duration;
int distance;
int speed=255;
String ch = "";

void setup()
{

delay(random(500,2000));
pinMode(A1_PIN, OUTPUT);
pinMode(A2_PIN, OUTPUT);
pinMode(A3_PIN, OUTPUT);
pinMode(A4_PIN, OUTPUT);
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600);
while (! Serial);
Serial.print("Please enter F, B, S");

}

void loop()
{
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;

// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}

{
analogWrite(8, speed);
}
while (Serial.available());
{
ch=Serial.readstring();

{
if (ch=="F")
{
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, HIGH);
Serial.println("Motor go Forwards");
}

else if (ch=="B")
{
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, HIGH);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor go Bachwards");
}

else if (ch=="S")
{
digitalWrite (A1_PIN, LOW);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor Stop");
}

else if (ch=="L")
{
digitalWrite (A1_PIN, LOW);
digitalWrite (A2_PIN, HIGH);
digitalWrite (A3_PIN, HIGH);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor Turn Left");
}

else if (ch=="R")
{
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, HIGH);
Serial.println("Motor Turn Right");
}

else if (ch=="G")
{
digitalWrite (A1_PIN, LOW);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, HIGH);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor go Forwards Left");
)

else if (ch=="H")
{
digitalWrite (A1_PIN, LOW);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, HIGH);
Serial.println("Motor go Backwards Left");
}

else if (ch=="I")
{
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor go Forwards Right");
}

else if (ch=="J")
{
digitalWrite (A1_PIN, LOW);
digitalWrite (A2_PIN, HIGH);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, LOW);
Serial.println("Motor GO Backwards Right");
}

else if (ch=="1")

{
speed=25.5;
Serial.println("Speed 10%");
}

}
else if (distance > 3000)
{
digitalWrite (A1_PIN, LOW); //Stop
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, LOW);
delay(500);
//movebackword
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, HIGH);
digitalWrite (A4_PIN, LOW);
delay(500);
digitalWrite (A1_PIN, LOW); //Stop
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, LOW);
delay(100);
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, HIGH);
delay(500);
digitalWrite (A1_PIN, HIGH);
digitalWrite (A2_PIN, LOW);
digitalWrite (A3_PIN, LOW);
digitalWrite (A4_PIN, HIGH);
Serial.println("Motor go Forwards");
}

}

}

Try this. You had some syntax errors, with these ( ) when these { } were needed instead.
You had { & } in what looked like incorrect places, take a look and see how I cleaned them up.
You had Serial.readstring(), which the compiler didn't like.

Next time you make changes, use CTRL-T to align the code like I did, it makes the { } syntax errors a lot easier to spot.

const int A1_PIN = 7;  // these could all be byte, no value is above 255
const int A2_PIN = 6;
const int A3_PIN = 4;
const int A4_PIN = 3;
const int trigPin = 9;
const int echoPin = 10;
long duration;
int distance;  // should this be a float?
int speed = 255;
String ch = "";
void setup ()
{
  delay (random (500, 2000));
  pinMode (A1_PIN, OUTPUT);
  pinMode (A2_PIN, OUTPUT);
  pinMode (A3_PIN, OUTPUT);
  pinMode (A4_PIN, OUTPUT);
  pinMode (trigPin, OUTPUT); // Sets the trigPin as an Output
  pinMode (echoPin, INPUT); // Sets the echoPin as an Input
  Serial.begin (9600);
  while (! Serial);
  Serial.print ("Please enter F, B, S");
}

void loop ()
{
  // Clears the trigPin
  digitalWrite (trigPin, LOW);
  delayMicroseconds (2); // this should be multiples of 4

  // Sets the trigPin on HIGH state for 10 micro seconds
  digitalWrite (trigPin, HIGH);
  delayMicroseconds (10); // make this a multpiple of 4
  digitalWrite (trigPin, LOW);

  // Reads the echoPin, returns the sound wave travel time in microseconds
  duration = pulseIn (echoPin, HIGH);

  // Calculating the distance
  distance = duration * 0.034 / 2;  // is result to be a float? Or 'rounded' off to have no decimal point data?

  // Prints the distance on the Serial Monitor
  Serial.print ("Distance:");
  Serial.println (distance);

  analogWrite (8, speed);
  while (Serial.available ())
  {
    ch = Serial.read (); // need to fix this line - how many characters are coming in?

    if (ch == "F")
    {
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, HIGH);
      Serial.println ("Motor go Forwards");
    }
    else if (ch == "B")
    {
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, HIGH);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor go Bachwards");
    }
    else if (ch == "S")
    {
      digitalWrite (A1_PIN, LOW);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor Stop");
    }
    else if (ch == "L") // directions ask user to "Please enter F, B, S"
    {
      digitalWrite (A1_PIN, LOW);
      digitalWrite (A2_PIN, HIGH);
      digitalWrite (A3_PIN, HIGH);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor Turn Left");
    }
    else if (ch == "R") {
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, HIGH);
      Serial.println ("Motor Turn Right");
    }
    else if (ch == "G")
    {
      digitalWrite (A1_PIN, LOW);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, HIGH);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor go Forwards Left");
    }
    else if (ch == "H")
    {
      digitalWrite (A1_PIN, LOW);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, HIGH);
      Serial.println ("Motor go Backwards Left");
    }
    else if (ch == "I")  // missing this one??? some other character?
    {
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor go Forwards Right");
    }
    else if (ch == "J")
    {
      digitalWrite (A1_PIN, LOW);
      digitalWrite (A2_PIN, HIGH);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, LOW);
      Serial.println ("Motor GO Backwards Right");
    }
    else if (ch == "1")
    {
      speed = 25.5; // analog write only supports 0 to 255, not floats
      Serial.println ("Speed 10%");
    }
    else if (distance > 3000)
    {
      digitalWrite (A1_PIN, LOW); // Stop
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, LOW);
      delay (500);
      // movebackword
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, HIGH);
      digitalWrite (A4_PIN, LOW);
      delay (500);
      digitalWrite (A1_PIN, LOW); // Stop
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, LOW);
      delay (100);
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, HIGH);
      delay (500);
      digitalWrite (A1_PIN, HIGH);
      digitalWrite (A2_PIN, LOW);
      digitalWrite (A3_PIN, LOW);
      digitalWrite (A4_PIN, HIGH);
      Serial.println ("Motor go Forwards");
    }
  }
}