how to break out servo.write(angle) after it reach the angle?
You change the angle in small increments until the sensor triggers:

bool closing = false;
bool openeing = false;
int angle;

void loop(){

    //read touchSensor

    if(sensorHit){
        closing  = false;
    }
    if(closing){
        if(angle &lt;= minAngle) closing = false;
        angle -= 1;
        myservo.write(angle);

    }

    if(opening){
        if(angle &gt;= maxAngle) opening = false;
        angle += 1;
        myservo.write(angle);

    }

}


The to start moving the grasper you set opening or closing to true. You can also add some trigger logic in the places where they get set back to false for the next movement if applicable.