servos not holding when switch is pressed

im working on a bit of animatronics and i have half the program correct and working right. but the other half for buttons C and D are not holding when the switch is pressed. it moves in the direction that I want but it goes back to neutral position then back up to the programmed position when the button is pressed. im not sure what is up but the code looks right.

here is the program can you please help...im a bit lost as far as what to do now.

#include <Servo.h>

Servo wag;  // left and right direction for the tail
Servo mood; // up and down direction for the tail
 int pos = 90;    // servo start position
 int buttonA = 12;  // tail wag on Pin 12
 int buttonB = 8; // standing tail wag, slow on pin 11
 int buttonC = 7; //happy mood no wag, on pin 10
 int buttonD = 4; //sad/scared mood no wag on pin 9
 int A = 0;
 int B = 0;
 int C = 0;
 int D = 0;
 
 void setup() 
{ 
  wag.attach(6);  // wag motion pin 6 output
  mood.attach(5); //mood motion pin 5 output
 pinMode(pos, OUTPUT);
 pinMode(buttonA, INPUT);
 pinMode(buttonB, INPUT);
 pinMode(buttonC, INPUT);
 pinMode(buttonD, INPUT);
 digitalWrite(12, HIGH);
 digitalWrite(8, HIGH);
 digitalWrite(7, HIGH);
 digitalWrite(4, HIGH);
} 
 
 void loop()
 //this section for button A, fast wag
{
 A = digitalRead(buttonA);
 if (A == LOW)
 {
   for(pos = 90; pos < 130; pos += 4)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    wag.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  delay(250);
  for(pos = 130; pos>=47; pos-=4)     // goes from 180 degrees to 0 degrees 
  {                                
    wag.write(pos);              // tell servo to go to position in variable 'pos' 
    delay(15);                       // waits 15ms for the servo to reach the position 
  } 
  {
  delay(250);
  }

  if (A == 0)
  {
    for(pos = 47; pos<=90; pos+=4)
    {
      wag.write(pos);
      delay(15);
    }
  }
 //this section bellow is for buttonB, slow wag
 }
    B = digitalRead(buttonB);
  if (B == LOW)
  {
    for(pos = 90; pos < 130; pos += 2)
    {
    wag.write(pos); delay(15);
    }
    delay(100);
    for(pos = 130; pos >=47; pos -= 2)
    {
    wag.write(pos), delay(15);
    }
    delay(15);
  }


  if(B == 0)
  {
    for(pos = 47; pos<=90; pos+=2)
    {
      wag.write(pos);
      delay(15);
    }
  }

 //this section bellow is for button C, happy mood
 C = digitalRead(buttonC);
 if (C == LOW)
 {
   for(pos = 90; pos <=150; pos+=4)
   {
     mood.write(pos); delay(15);
   }
 }
 
 if (C == 0)
 {
   for(pos = 150; pos>=90; pos-=4)
   {
     mood.write(pos); delay(15);
   }
 }

 //this section bellow is for button D, sad/scared mood
  D = digitalRead(buttonD);
 if (D == LOW)
 {
   for(pos = 90; pos >=20; pos-=4)
   {
     mood.write(pos); delay(15);
   }
 }
 
 if (D == 0)
 {
   for(pos = 20; pos<=90; pos+=4)
   {
     mood.write(pos); delay(15);
   }
 }
}

You haven't described how the switches are wired. You are not using the internal pullup resistors, so you need external ones, which simply complicate the wiring.

but the other half for buttons C and D are not holding when the switch is pressed.

Half the code is not holding? That doesn't make sense.

  {
  delay(250);
  }

Useless curly braces. Get rid of them.

 A = digitalRead(buttonA);
 if (A == LOW)
  if (A == 0)

As opposed to LOW?

buttons A and B are for the back and forth wag. the servos are just supposed to sweep back and forth when the button is pressed. and then the button is not pressed they go right back to 90...thats what i wanted them to do and they do that well.

Buttons C and D are the mood, either happy or sad. those are the 2 that are supposed to hold the position until the button is released.

Buttons C and D are the mood, either happy or sad. those are the 2 that are supposed to hold the position until the button is released.

Then why are you moving the servo one way, and then the other? It seems to me that you want to move one servo one way when the switch is pressed and the other way when it is released.

correct. thats exactly what i want them to do but right not they are moving from the start degree to end degree and repeating when the button is pressed

So, for the C and D switches, you need to detect when the transition from released to pressed and from pressed to released happens. That will require that you save the previous state of the switches, to compare to the current state.

Look at the StateChangeDetection example in the Digital area.

Why check if the switch state is LOW and after you have acted on it check if is 0 (which is the same thing) and act on it again ?