How can body segments be moved to precise angles in snake robot?
You could use worm gears, or worm gears, or compound worm gears, because you can slow the rotation down as much as you want, which means you can have super fine rotation.

An extreme example of this would be the 120 years timer here

This uses a compound worm gear and spur gear train.

Worm gears also have a lot of torque in a small space.

if you want the snake to sway left but then automatically sway right then just hook do something like this but like the following: 

The red pin goes to the snakes body which should 'sway' because of the linkages converting rotary motion into oscillating motion. just make sure that the other half of the snakes body is anchored to the motors housing other wise it will be a retarded snake :)