Yep, mine had the same problem.. I had a function that was supposed to make the robot move left if it had a positive input and right if it was a negative value, and it always crashed when the robot turned right.
This code is the function I'm talking about, and with the addition of the line, "nSyncedMotors=synchNone;" it works great every run, with the single exception that it doesn't turn exactly the same amount left versus right for some reason, but I'll try to figure that out some other time..
Ok, I must have missed that you posted your entire program earlier... Sorry. I think that does look like a bug, since abs() does take a short int, and it looks like the nMotorEncoder returns a short int... Anyhow, correct me if I'm wrong, but if you just set the nMotorEncoderTarget, won't the motor stop after it reaches the target anyhow? You could use something like while(nMotorRunState != runStateIdle) there right? Just a suggestion, but these NXT's are pretty quirky with this code still.. Sorry again for not looking at your code before posting earlier. Your problem is nothing like I thought at first.