RFID module won't save when unplugging?

Whenever I wrote a script to my RFID reader/write, for example:

void setup(){
	Serial.begin(9600); //S�t baud-rate	
        pinMode(8,OUTPUT); //Pin 3 er debugging LED
}
void loop(){
	int hasrun = 0;
	if(hasrun == 0){
		Serial.write("AB 02 01");
		hasrun = 1;
		if(Serial.available()){
			digitalWrite(8,HIGH); //T�nd LED
			delay(200);
			digitalWrite(8,LOW); //Sluk LED
			delay(200);
			digitalWrite(8,HIGH); //T�nd LED
			delay(200);
			digitalWrite(8,LOW); //Sluk LED		
		}
	}
	
}

it's like it won't save it...
Whenever I got it to work, and I unplug the device and then plug it in again, the MODE button won't light up before I press upload.

What's hasrun supposed to be about?

I expect the reason your LED isn't lighting is because you only turn it on when there is Serial input available. I don't know what's happening on your serial port, but since you say the LED isn't lighting up I'd guess not very much.

If you write a sketch that does something sensible, you should see it running as soon as you power up the Arduino.