Weird long delay inbetween functions

I created this code years ago but then needed to resurrect it to recreate a previous project. Basically what it does is talk to a Sparkfun TB6612FNG breakout to control a motor for a cats laser toy. I had more code in this sketch for a pause type function but tore a lot of code out trying to figure out whats going wrong. Everything seems to work except in between function within the main VOID LOOP I am getting a weird 60+ second delay when there should be none.
I build the entire circuit on a protoboard with the bare Atmel chip and a crystal so I wasnt sure if I did something wrong. I bought a couple Arduino Pros and wired them into my circuit using on the Sparkfun breakout board and I am getting the same exact thing so it must be the code.
I then went to a website to simulate and Arduino with my code and on the motor output pins I just connected a couple virtual voltometers and everything appears to work correctly.

Here is the stripped down code

#include <avr/sleep.h>

#define RST 0 //reset output
#define SWIN1 2 //switch input
#define PWML 3  //PWM Laser driver signal
#define PWMA 12  //PWM motor driver signal
#define AIN2 11 //Direction control 2
#define AIN1 10 //Direction control 1
#define STBY 9 //Standby signal
#define RDY 13 //Onboard LED
int delaytimerun = 0; //Length of time motor will run
int delaytimepause = 0; //Length of time between actions
int drivespeed = 0; //Analog drive speed 0-255
int loopcount = 0; //How many times a mode will run

void setup() {
  pinMode(SWIN1, INPUT);
  pinMode(RST, OUTPUT);
  pinMode(PWMA, OUTPUT);
  pinMode(PWML, OUTPUT);
  pinMode(AIN1, OUTPUT);
  pinMode(AIN2, OUTPUT);
  pinMode(STBY, OUTPUT);
  pinMode(RDY, OUTPUT);
  digitalWrite(RST, HIGH);
  digitalWrite(RDY, HIGH);
  digitalWrite(PWML, HIGH);
  digitalWrite(STBY, HIGH);
  mc_off();
  mc_on();
  spintest();
}

void loop() {
  loopcount = 15;
  fast_twitch();
  loopcount = 15;
  sweep();
  loopcount = 15;
  crazy();
  loopcount = 15;
  slow_sweep();
}


void fast_twitch() {
  for (int i = 0; i < loopcount; i++) {
    delaytimepause = random(10, 350);
    delaytimerun = random(1, 30);
    drivespeed = random(125, 254);
    forward();
    delaytimepause = random(10, 350);
    delaytimerun = random(1, 30);
    drivespeed = random(125, 255);
    reverse();
  }
}

void sweep() {
  for (int i = 0; i < loopcount; i++) {
    delaytimepause = random(100, 3000);
    delaytimerun = random(5, 750);
    drivespeed = random(60, 90);
    forward();
    delaytimepause = random(100, 3000);
    delaytimerun = random(5, 750);
    drivespeed = random(60, 90);
    reverse();
  }
}

void crazy() {
  for (int i = 0; i < loopcount; i++) {
    delaytimepause = random(1, 2500);
    delaytimerun = random(1, 150);
    drivespeed = random(60, 254);
    forward();
    delaytimepause = random(1, 2500);
    delaytimerun = random(1, 150);
    drivespeed = random(60, 254);
    reverse();
  }
}

void slow_sweep() {
  for (int i = 0; i < loopcount; i++) {
    delaytimepause = random(100, 2000);
    delaytimerun = random(100, 1150);
    drivespeed = random(5, 80);
    forward();
    delaytimepause = random(100, 2000);
    delaytimerun = random(100, 1150);
    drivespeed = random(5, 80);
    reverse();
  }
}

void mc_off() {
  digitalWrite(STBY, LOW);
}

void mc_on() {
  digitalWrite(STBY, HIGH);
}

void spintest() {
  drivespeed = 255;
  delaytimepause = (50);
  for (int fiveoo = 0; fiveoo < 300; fiveoo = fiveoo + 50) {
    delaytimerun = (fiveoo);
    forward();
    reverse();
  }
  delay(2000);
}

void forward() {
  digitalWrite(AIN1, HIGH);
  digitalWrite(AIN2, LOW);
  analogWrite(PWMA, drivespeed);
  delay(delaytimerun);
  coast();
  delay(125);
  brake();
  delay(delaytimepause);
}

void reverse() {
  digitalWrite(AIN1, LOW);
  digitalWrite(AIN2, HIGH);
  analogWrite(PWMA, drivespeed);
  delay(delaytimerun);
  coast();
  delay(125);
  brake();
  delay(delaytimepause);
}

void brake() {
  digitalWrite(AIN1, HIGH);
  digitalWrite(AIN2, HIGH);
}

void coast() {
  digitalWrite(AIN1, LOW);
  digitalWrite(AIN2, LOW);
}

Have you tried putting in some Serial.prints() at significant points in the code so that you track what code is being executed and the value of significant variables at that point ?

I can't help noticing that your code is littered with delay()s, some of which are withing for loops which will amplify their effect.

Haven't tried that yet cause the chip is running in a custom made board with no serial but I can pop it out and run it in the Arduino Due I have and see what the prints say.
The code is old when I was just starting out and worked fine then but I suspect something may have changed along the way and I may need to go through and change all the delays to see what I get.
Its odd that the simulator works fine with my code.

OK so I added a bunch of serial output and found the code worked exactly as expected. I ended up needing to add a header to my board so I could monitor the serial output while it was running and then I noticed something odd. I was seeing the serial output I should but the toy was doing nothing. What I had found is anything less than a PWM Output of 160 isnt picked up by the motor.
This is very strange considering its the same exact motor, the Sparkfun motor driver is different but the same make and model. I am still driving the circuit with 5V but previously I used a 5V wall adapter and now I am using a 9V adapter with a 5V regulator.
I noticed the toy moved way to quick as well, I was thinking of drawing another line off the 3.3V regulator that i use to drive the Laser and run that into the VM pin on the motor driver. This should slow down the motor quite a bit and if using a PWM signal lower than 160 is an issue than this would also possibly resolve that but give me less room to adjust the speed of the motor overall.