Your code seemed a little complicated, correcting things afterwards, etc, so I had a go at it.
I got a much simpler version in two iterations, I'll show them both or it will look like total magic, perhaps :)
(all code is untested, and may contain errors)
float diffAngle = destAngle - currentAngle;
if (diffAngle > Math.PI) {
// Rotating towards positive angle inefficiently, rotate the other way around.
currentAngle = currentAngle - 0.1;
if (currentAngle < -Math.PI) { currentAngle += 2 * Math.PI; }
} else if (diffAngle < -Math.PI) {
// Rotating towards negative angle inefficiently, rotate the other way around.
currentAngle = currentAngle + 0.1;
if (currentAngle > Math.PI) { currentAngle -= 2 * Math.PI; }
} else {
// diffAngle direction is fine, just limit to within 0.1 around 0
diffAngle = Math.min(0.1, diffAngle);
diffAngle = Math.max(-0.1, diffAngle);
currentAngle += diffAngle;
}
The idea is that rotating towards the destination angle (destAngle) is always fine, except when the rotation angle is too big or too small (ie more than +/- PI). The first two cases handle rotating the other way around in that case. Note that the next time you evaluate this code, the rotation angle only gets bigger (we rotated in the wrong direction), so it will get caught again in the 'rotate in counter direction', and continue to rotate "in the wrong way".
Eventually, you pass the -PI or +PI angle, and then you'll be in the 'normal' fine way to just rotate towards the destination angle.
The 3rd case handles that. It clips the difference between 0.1 and -0.1, and just adds that to the current angle. Anything bigger than the limit rotates 0.1 in the right direction, anything less than the limit just jumps to the destination angle.
So far so good. A lot better than your solution, but the 2 cases looked a lot like the problem that is being solved in the 3rd case. Also, I'd really like to use that -0.1 and 0.1 limit thing in the first two cases too. After some thinking I came up with this:
float diffAngle = destAngle - currentAngle;
if (diffAngle > Math.PI || diffAngle < -Math.PI) diffAngle = -diffAngle;
diffAngle = Math.min(0.1, diffAngle);
diffAngle = Math.max(-0.1, diffAngle);
currentAngle += diffAngle;
if (currentAngle > Math.PI) currentAngle -= 2 * Math.PI;
if (currentAngle < -Math.PI) currentAngle += 2 * Math.PI;
After computing the difference, I now decide the direction of movement in 'diffAngle', by reversing its sign if needed.
Then I limit the difference to the -0.1 to 0.1 interval, and add it to the currentAngle.
Since I may be moving in the 'wrong' direction, afterwards, the currentAngle may need adjustment to stay in its limits.