RFID + servo working... servo does not stop rotating

hi! i have RDM630 and mega 2560. its working now. However, when I tap the authorized key tag it does not stop rotating. I want my servo motor to be rotating for only about 5 secs in both direction when an authorized key tag is tapped. Im using it for a lock. please help, here's my code:

//the LED turns on or blink

#include <SoftwareSerial.h>
#include <Servo.h>
SoftwareSerial RFID = SoftwareSerial(10,11);

Servo myservo; // create servo object to control a servo
// a maximum of eight servo objects can be created

int pos = 0; // variable to store the servo position
char character;
String our_id;

void setup() {
myservo.attach(12); // attaches the servo on pin 12 to the servo object
Serial.begin(9600);
RFID.begin(9600);
pinMode(13, OUTPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
}

void servo()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position

}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
// loop ();

//myservo. detach ();

}
}

void loop() {

while(RFID.available()>0)
{
character = RFID.read();
our_id += character;
}

if (our_id.length() > 10) {
our_id = our_id.substring(1,13);
if (our_id == "76002C2AF686")
{
Serial.print ("USER: Rowena Joy C. Perez \n");
Serial.print("ACCESS GRANTED (id: ");
Serial.print(our_id);
our_id = "";
Serial.println(" ) ");
servo ();
digitalWrite(8, HIGH);
//digitalWrite(13,HIGH);
delay(1000);
digitalWrite(8,LOW);
// digitalWrite(13, LOW);
delay(1000);

}
else
{
Serial.print ("UNAUTHORIZED USER \n");
Serial.print("ACCESS DENIED (id: ");
Serial.print(our_id);
our_id = "";
Serial.println(" ) ");

digitalWrite(13,HIGH);
int x = 3;
for (x; x > 0; x--)
{
delay(100);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(9, LOW);
}
digitalWrite(13,LOW);

}
}

our_id = "";
delay(1000);
}

I don't see any obvious problems in the sketch. Does the servo still repeat going back and forth even with no card near the reader?

Is there some reason why you want the servo to move slowly? Typically you would just open the lock, wait a reasonable amount of time, and close it again:

    myServo.write(180); // Release the lock
    delay(3000);  // Allow three seconds for the door to be opened
    myServo.write(0);  //  Re-enable the lock

You don't actually appear to be telling your servo myservo (In function servo() which is never called) to do anything.

You do drive some pins high and low for 1 tenth of a second though.

johnwasser... that's exactly my problem. if the authorized key tag is tapped the servo motor continue to rotate back and forth and even when i tap another unauthorized key tag it doesnt stop