Linear actuator reverse conflict in code

I do not have a hardware issue, the linear actuator goes forwards and reverse just fine it is a timing issue in the coding that is the problem.