NXT brick erratic programming behavior
Looks like it might be a defective motor driver chip (though they are pretty tough!). What happens if you connect the motor on another port of the same brick? (with program change to reflect port modification)