Noob need help with Arduino programmimg

hi guys

totally new to programming and electronics this is a project for a laser toy for my cat

this is my code so far the trouble is it only runs the sequence twice then stops

#include <Servo.h>

Servo vert;
Servo hor;

const byte pirInputPin = 6;
const byte lightSensorPin = 5;
unsigned long runDelayStartTime=0;
unsigned long startTime=0;
unsigned long setTime=1200000; //20 minutes in millis is 1000 * 60seconds * 20 minutes
unsigned long runDelayTime=3600000; //1hour in millis is 100060secs60mins
byte runLaserShow=0;
byte runDelay=0;

void setup() {
vert.attach(10);
hor.attach(11);
pinMode (pirInputPin, INPUT);
pinMode (lightSensorPin, INPUT);

}

void migrate(Servo &myServo, int newPos) {
int wait = random(1, 20); //randomize the wait to make it more interesting
int pos = myServo.read(); //Read the current servo position
if (pos < newPos) {
for (int i = pos; i < newPos; i++) {
myServo.write(i);
delay(wait);
}
} else {
for (int i = pos; i > newPos; i–) {
myServo.write(i);
delay(wait);
}
}
}

void randomPosition() {
int rand = random(10, 100); //The range is limited to 60 deg for better cat action
migrate(hor, rand);

rand = random(40, 110); //The vertical range is limited to 45 deg also for better cat action.
migrate(vert, rand);
}

void loop() {
//state of day/night switch relay equals Day,Output OFF
unsigned long currentTime = millis();
byte pirsensor = digitalRead(pirInputPin);
byte dayNightSensor = digitalRead (lightSensorPin);

if (dayNightSensor == LOW) { // its daytime
if (pirsensor == HIGH) { //movement sensed
//we will not add a 2 minute delay as thats avilable on hardware
runLaserShow = 1;//this is a flag saying that we want the laser light to start
}
}

if (runLaserShow == 0 && runDelay == 0) {//this keeps resetting a timer used to measure 20 mins
startTime = currentTime;//update starttime to millis
}

if (runDelay == 0) {// 1 hour lock out if rundelay==1
if (runLaserShow == 1) {//we want to have a light show
if (currentTime - startTime >= setTime) {
//times up
runLaserShow = 0;//remove flag
runDelay = 1;//set a flag to stop the show for 1 hour
runDelayStartTime = currentTime;//take a time stamp so we can measure a hour
} else {
randomPosition();//timers running so do this until time is up
}
}
}

if (runDelay == 1) {//has i hour passed since last laser show
if(currentTime - runDelayStartTime >= runDelayTime) {
runDelay = 0;//one hour is up remove flag
}
}
}

any help will be appreciated
Rregards

Kevin

Can you give more info about where it hangs? Try putting a few Serial.print() statements throughout the loop that will report the state of your variables so we can see what’s going wrong.