Best control structure for task of aligning motor with sensor

Well, thanks to the tips I got here, I got the detection part to work perfectly. I only need 3 sensors now to correct both azimuth and tilt, although I haven't actually done that yet; still using 4.

Now, onto the next item, actually switching the relays to control the motors is giving me fits, LOL It should be pretty simple: When a correction is indicated, call one of 4 functions to rotate CW, CCW, tilt up & tilt down, and keep the relay on until the values equalize. I've tried a few things, and get close, but no cigar.

void rotateCW ()
{
    digitalWrite(EQUALIZED_LED, LOW);
    digitalWrite(MOVING_LED, HIGH);
    digitalWrite(RELAY_ROTATE_CW, HIGH);
    
    
  sensorValue_leftPCell = analogRead(leftPCell);
  sensorValue_rightPCell = analogRead(rightPCell);
  differenceLR = (sensorValue_rightPCell)-(sensorValue_leftPCell);
  if(differenceLR > (MIN_DELTA))
  {
    digitalWrite(RELAY_ROTATE_CW, LOW); 
  }
  else
  {
  }

I thought I understood that once a function was called, it stayed in the function until it was satisfied and exited the call, then went back to loop. But it now calls occasionally for both directions at once. Obviously, I am missing something...somethings.
I see now that programming is a lot like chess, a few minutes to learn the pieces and their moves, a lifetime to learn the game. It is fun, though.