How to control the line detector line position and drop the line

hi everyone, this is my source code to stop my line follower in position and drop anythings, but my code is very bad, my line follower is not stop,
Stop positions are 5 areas with black squares with a perimeter of 8cm x 8cm, i need help, please

#define in1 7
#define in2 6
#define in3 5
#define in4 4
#define ss1 13
#define ss2 12
#define ss3 9
//#define ss4 8
//#define cb1 8
//#define cb2 2
const byte enA=10;
const byte enB=11;
int tam=0,flag=0,flag1=0,a=0;
//unsigned long time1 = 0;
//unsigned long time2 = 0;
void setup() {
Serial.begin(9600);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
pinMode(enA,OUTPUT);
pinMode(enB,OUTPUT);
pinMode(ss1, INPUT);
pinMode(ss2, INPUT);
pinMode(ss3, INPUT);

}

void stop()
{
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);

}

void back()
{
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

}

void go()
{
analogWrite(enA,60);
analogWrite(enB,60);

digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);

}
void left()
{
analogWrite(enA,120);
analogWrite(enB,90);

digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
}
void right()
{
analogWrite(enA,90);
analogWrite(enB,120);

digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
}

void line()
{
int s1=digitalRead(13);
int s2=digitalRead(12);
int s3=digitalRead(9);
//int s4=digitalRead(8);
if(((s1==LOW)&&(s2==LOW)&&(s3==HIGH))||((s1==LOW)&&(s2==HIGH)&&(s3==HIGH)))

{
phai();
}

if(((s1==HIGH)&&(s2==LOW)&&(s3==LOW))||((s1==HIGH)&&(s2==HIGH)&&(s3==LOW))||((s1==HIGH)&&(s2==LOW)&&(s3==HIGH)))

{
trai();
}

if(((s1==LOW)&&(s2==HIGH)&&(s3==LOW))||((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH)))

{
tien();
}
}

void loop(){

int s1=digitalRead(13);
int s2=digitalRead(12);
int s3=digitalRead(9);

if(((s1==LOW)&&(s2==LOW)&&(s3==HIGH))||((s1==LOW)&&(s2==HIGH)&&(s3==HIGH)))

{
right();
}

if(((s1==HIGH)&&(s2==LOW)&&(s3==LOW))||((s1==HIGH)&&(s2==HIGH)&&(s3==LOW)))//||((s1==HIGH)&&(s2==LOW)&&(s3==HIGH)))

{
left();
}

if(((s1==LOW)&&(s2==HIGH)&&(s3==LOW)))//||((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH)))
{
go();

}
if((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH))
{
a=a+1;

while((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH))
{
if(a==5)
{
stop();
delay(2000);
}
// time1=millis();
//Serial.println(time1 );
if(a==7)
{
stop();
delay(2000);
}
if(a==9)
{
stop();
delay(2000);
}if(a==13)
{
stop();
delay(2000);
}if(a==17)
{
stop();
delay(2000);
}
go();
delay(500);
line();

}

}

}

http://forum.arduino.cc/index.php/topic,148850.0.html See #7 & 11

   while((s1==HIGH)&&(s2==HIGH)&&(s3==HIGH))
   {
    if(a==5)
    {
      stop();
      delay(2000);
    }
   // time1=millis();
    //Serial.println(time1 );
    if(a==7)
    {
      stop();
      delay(2000);
    }
    if(a==9)
    {
      stop();
      delay(2000);
    }if(a==13)
    {
      stop();
      delay(2000);
   }if(a==17)
   {
      stop();
     delay(2000);
   }
   go();
delay(500);
   line();
 

   }
 
}

Once you get into that while loop, you have no way of getting out, no matter what the sensors detect, because you never read them again. Surely, THAT can't be what you want.

can you help me fix my code, please !!!