useing millisDelay.h. am i on the right track. first code written

Can somebody with a bit more knowledge than me ( very easy by the way) run there eye over this and see if i am heading in the right direction, or should start over.

so far most of what i read seems like algebra to me, hate algebra by the way, i am more of a hands on type of bloke.
thanks heaps folks

/*
 * Made to run on Arduino uno clone
 * this code is to run linear actuators with out position sensors
 * but have inbuild stop switches in actuators
 * to be used as auto gate openers
 * useing 2 H bridge units to drive
 * delay time is to allow sufficent run time to open or close gates
 * overrun is not a concern as actuators stop at limits
*/
#include <millisDelay.h>


const unsigned long DELAY_TIME = 30000; // in mS (2sec)
bool delayRunning = false; // true if still waiting for delay to finish
millisDelay GateRun;  // the delay object or gate run time
millisDelay GateHold; //pause gates to allow transit
int pedestrian =3;    //open small gate only
 int OpenGates = 4;    // open both gates
  int stopfeedA = 5;    // sensor eye A to digital pin 5
   int stopfeedB = 6;    // sensor eye B to digital pin 6
    int OpenGate2 = 7;    // open gate to motor2 digital pin 7
     int OpenGate1 = 8;    // open gate to motor1 on digital pin 8
      int CloseGate1 = 9;   // close gate to motor1 on digital pin 9
       int CloseGate2 = 10;  // close gate to motor2 on digital pin 10


void setup() {       // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(OpenGate2, OUTPUT);        // open gate 2
  pinMode(OpenGate1, OUTPUT);        // open gate 1
  pinMode(CloseGate1, OUTPUT);       // Close Gate 1
  pinMode(CloseGate2, OUTPUT);       // Close Gate 2
pinMode(stopfeedB, INPUT_PULLUP);    // EMERGENCY STOP GATES
pinMode(stopfeedA, INPUT_PULLUP);    // EMERGENCY STOP GATES
pinMode(OpenGates, INPUT_PULLUP);    // OPEN GATES 
}

void loop() {      // to run repeatedly:

  
//   THIS SECTION TO RUN MAIN GATES   //////////////////////////////////////
if (digitalRead(OpenGates) == LOW){  
     digitalWrite(OpenGate1, HIGH);      // Open Gates
     digitalWrite(OpenGate2, HIGH);      // Open Gates
     GateRun.start(DELAY_TIME);          // STARTS TIMER 
     Serial.println("GateRun.start(10000) called and gates opening"); 
     delay (250);                        // wait for a 1/4  second 
     }
       if (GateRun.isRunning()) { 
      } else {
        Serial.println("Delay already finished. Calling GateRun.finish() stops gates");
        digitalWrite(OpenGate1, LOW);     // turn gate open off
        digitalWrite(OpenGate2, LOW);     // turn gate open off 
        delay (250);                      // wait for a 1/4  second
      //  GateRun.finish();                 // shuts down timer
        GateHold.start(DELAY_TIME); {     // STARTS TIMER
      }
//  This section is to reclose Gates after being opened    /////////////////////   
 
   
   if (GateHold.isRunning()){ 
   digitalWrite(CloseGate1, LOW);    //close gates off
   digitalWrite(CloseGate2, LOW);    //close gates off
   delay (250);                      // wait for a 1/4  second 
   
} else {
   Serial.println("Delay already finished. Calling GateRun.finish() stops gates");    
   digitalWrite(CloseGate1, HIGH);   //close gates ON
   digitalWrite(CloseGate2, HIGH);   //close gates ON
   delay (250);                      // wait for a 1/4  second 
  //  GateHold.finish();                // shuts down timer
}
///////////  THIS SECTION IS EMERGENCY STOP ////////////////////////////////////
if (digitalRead(stopfeedB) == LOW) {
  
  Serial.println("Emergency stop B pressed stops gates");
  digitalWrite(OpenGate1, LOW);        // emergency stop
  digitalWrite(OpenGate2, LOW);        // emergency stop
  digitalWrite(CloseGate1, LOW);       // emergency stop
  digitalWrite(CloseGate2, LOW);       // emergency stop
  
}
if (digitalRead(stopfeedA) == LOW) {
  
  Serial.println("Emergency stop A pressed stops gates");
  digitalWrite(CloseGate1, LOW);      // emergency stop
  digitalWrite(CloseGate2, LOW);      // emergency stop
  digitalWrite(OpenGate1, LOW);       // emergency stop
  digitalWrite(OpenGate2, LOW); }     // emergency stop
  Serial.println("end script and rerun");
  delay(5000);
}
} :o

Where did you get millisDelay.h from ?

const unsigned long DELAY_TIME = 30000; // in mS (2sec)

Is the comment or the code correct ?

millisDelay cam from here i beleave

/*

  • (c)2018 Forward Computing and Control Pty. Ltd.
  • NSW Australia, www.forward.com.au
  • This code is not warranted to be fit for any purpose. You may only use it at your own risk.
  • This generated code may be freely used for both private and commercial use
  • provided this copyright is maintained.
    */

to tell the truth just a look through the whole thing and see if its a viable way to do it or scrap it and re think it out.
i want to figure this out but if i am barking up the wrong tree then a bit of advice is always welcome.
this is my first foray into code other than Dos batch files.
so its a bit of a learning curve.
More of a vertical climb than a curve but i think i am getting there.
i have read so many different teach your self arduino in ten minutes type blogs ect
that the head is spinning.

the button presses seem to work its the timer that i am struggling with

The demo Several Things at a Time illustrates the use of millis() to manage timing without blocking. It may help with understanding the technique.

Have a look at Using millis() for timing. A beginners guide if you need more explanation.

...R