Let's look at a small section of your code
void loop()
{
pingRight();
rightDistance = microsecondsToCentimeters(durationRight);
delay(300);
pingLeft();
leftDistance = microsecondsToCentimeters(durationLeft);
delay(300);
Presumably the pingRight and pingLeft functions are meant to measure the distances right and left, but if you look at either of them they do not move the pan servo.