Looking for some help in stopping this motorized potentiometer midway

Very very very very close!

So I've gotten it to stop in the middle, except it shakes fervently back and forth in the middle.

I think it has to do with conflicting messages in the motor move function.

//=====INITIALIZE PINS========

int PinA1 = 6;    // H-bridge leg 1 (pin 2, 1A) PWM
int PinA2 = 5;    // H-bridge leg 2 (pin 7, 2A) PWM
int enablePin = 9;    // H-bridge enable pin

//For proper lineTrack readings, insert 2 to A5, 3 to 5V, 1 to GND
int lineTrack = A5;    //line track for position reading
int potVal;

int inByte = 0;   // for incoming serial data
//=============================

void setup(){

  Serial.begin(57600);    

  // set the line track as input
  pinMode(lineTrack, INPUT);

  //set the motor logic pins and enable pin as outputs
  pinMode(PinA1, OUTPUT);
  pinMode(PinA2, OUTPUT);
  pinMode(enablePin, OUTPUT);
}

void loop() {

  // set enablePin high so that motor can turn on:
  potVal = analogRead(lineTrack);

  // if we get a valid byte, read analog ins:
  if (Serial.available() > 0) {
    // get incoming byte:
    inByte = Serial.read();
    Serial.println(inByte);

    if (inByte == 97) {
      moveToTarget1(0);
    }

    if (inByte == 98) {
      moveToTarget1(1023);
    }

    if (inByte == 99) {
      moveToTarget1(512);
    }
  }
}

void moveToTarget1(int target)
{
  int pos;
  potVal = analogRead(lineTrack);

  if ( potVal > (target) )
  {
    digitalWrite(enablePin, HIGH);
    analogWrite (PinA1, 150);  //Move backwards
    analogWrite (PinA2, 30);
    potVal = analogRead(lineTrack);
    pos = potVal;
  }


  if ( potVal < (target) )
  {
    digitalWrite(enablePin, HIGH);
    analogWrite (PinA1, 30);        //Move forward
    analogWrite (PinA2, 150);
    potVal = analogRead(lineTrack);
    pos = potVal;
  }

  if ( potVal < target+3 && potVal >target-3)
  {
    digitalWrite(enablePin, LOW);  //Stop
    digitalWrite (PinA1, HIGH);
    digitalWrite (PinA2, HIGH);
    potVal = analogRead(lineTrack);
    pos = potVal;
  }
}