The first time the spindle starts in the rigid tap program it simply sets the CW bit. Your machine runs a little different and needs to clear the CCW bit and then set the CW bit. So i changed it out to match your machine.
Your welcome for the help. I had alot of help from others last fall when i was doing my machine, so nice to be able to give back a little now that i understand things a little better.