If the servo is "twitching" just on the startup of the code then you are okay.
This is just the servo going to it's initial position.
If the Servo is always twitching it might be a low backup battery.
For a transmission shifter you are best to have it on one switch.
0=low gear, 1=high gear
Also, make sure to stop the motorfor a few loops before shifting, and start the motors back up (to selected speed) after th3e servo has had a chance to move.
The psuedocode would look like this
Code:
// Motor speed 160 In Low Gear
Shift button changed // have static store last value
Store Motor Speed // in static for later use
Stop Motor // 127, neutral
Move Servo // 0-254 or 254-0
count loops for 10 (.2 secs, servo moves full throw in .11)
Start Motor
// Shift on the fly, You got to love it
Setup #defines to track the various points in the shift and switch/case through the shift process.
Hope this helps.
Phil