Code for using micro switch on Arduino

I wouldn't use interrupts at all for something this simple. Just connect the button and limit switch to digital inputs and write a sketch that waits for the button to be pressed, runs the motor forwards for five seconds, reverses the motor, waits until the limit switch is actuated, stops the motor.