Motor loop with time on and Delay

Hello,
I am attempting to control a motor via a SSR and a switch.

I would like to have the motor come on for 20 seconds then off for 30 minutes and repeat that pattern as long as the switch is on.

Here is my code so far, keep in mind that this is my first program and I am learning from google searches... Would this accomplish what I am trying to do?

int motor = A2;
int inPin1 = 3;
double p = 0;            //delay parameter
double longDelayInSeconds = 0;     //long delay parameter

void setup() {

  Serial.begin(9600);
  pinMode(A2, OUTPUT);     //SSR Coil
  pinMode(3, INPUT);       // set the pin to input   
 

}

void loop() {

if (inPin1 == LOW); {
  }
  if (inPin1 == HIGH); 
  {digitalWrite(motor, HIGH);
  delay(20000);                  // run for 20 seconds
  digitalWrite(motor, LOW);
  longDelayInSeconds = 1800; //30 minutes
  while (p < longDelayInSeconds) {
    delay(1000);}

No, I'm sorry, it is full of mistakes. You cannot cut & paste lines of code that you do not understand together and expect it to do what you wanted.

You need to work through the basic tutorials and understand them.

Would this accomplish what I am trying to do?

Does it compile ?

  if (inPin1 == LOW);

inPin1 is has a value of 3 and it is never changed. Given those facts, will it ever equal LOW ?
Do you know about the digitalRead() function ?

Will you ever require the Arduino to do anything other than wait 20 seconds and 30 minutes ? If so then this may influence how you accomplish the waiting .