Another delay topic

You didn't say what the 'some action' is. If it is a button press then this code will repeat if the button is held down. There are ways to deal with this but here is something to try with regard to the delay.

const byte gatepin = whatever you want;
unsigned long startTime;
unsigned long interval = 800;

void setup()
{
  pinMode(gatepin, OUTPUT);      
}

void loop()
{
  if (some action)  
  {
    digitalWrite(gatePin, HIGH);  
    startTime = millis();                //save the start time
  }

  if (millis() - startTime >= interval)  //test if required time has elapsed
  {
    digitalWrite(gatePin, LOW);    
  }
}