Program not working as intended

OK. The program simply needs to accelerate the motor, hold the speed until the Hall IC is triggered, slow down, stop for a set period of time and then start all over again.