Rain sensor and conveyor belt double check mechanism

So im trying to make a conveyor belt system using dc motors that has a rain sensor to check whether the items on the conveyor belt are still wet. im trying to make it so that the conveyor belt would continue to function as long as the items on it were still wet and once the items on it were dry it would take a full loop around the conveyor to make sure that all the items on it were totally dry. if they were dry after the double check it would move a servo motor to act as a blockage that pushes the items on the conveyor belt off. if they are not dry then the conveyor would keep going. Im trying to find a way to make the double check portion work by using if commands and another switch command but it doesnt seem to work… any suggestions??? note: im only using one rain sensor to check for the wetness.

here’s the code:

#include <Servo.h>
Servo Servo1;
int servoPin = 12;
const int sensorMin = 0;
const int sensorMax = 1024;
int MoPin1 = 2;
int MoPin2 = 3;
int MoPin3 = 6;
int MoPin4 = 7;

void setup() {
  Serial.begin(9600);
  Servo1.attach(servoPin);
  pinMode( MoPin1, OUTPUT );
  pinMode( MoPin2, OUTPUT );
  pinMode( MoPin3, OUTPUT );
  pinMode( MoPin4, OUTPUT );
  Serial.println("=====Initiating W.H.E.A.T.=====");
  delay(1000);
  Serial.println("---Beggining Initital Drying Phase---");
  Serial.println("");
}
void loop() {
  int sensorReading = analogRead(A0);
  int range = map(sensorReading, sensorMin, sensorMax, 0, 3);
      Servo1.write(180);
      delay(1000);
      digitalWrite(MoPin1, HIGH);
      digitalWrite(MoPin2, HIGH);
      digitalWrite(MoPin3, HIGH);
      digitalWrite(MoPin4, HIGH);
      delay(2000);

  // range value:
  switch (range) {
    case 0:    // Sensor getting wet
      Serial.println("Rice Grain Status : Very Wet");
      Serial.println();
      Servo1.write(180);
      digitalWrite(MoPin1, HIGH);
      digitalWrite(MoPin2, HIGH);
      digitalWrite(MoPin3, HIGH);
      digitalWrite(MoPin4, HIGH);
      //delay(1000);
      break;
    case 1:    // Sensor getting wet
      Serial.println("Rice Grain Status : Wet");
      Serial.println();
      Servo1.write(180);
      digitalWrite(MoPin1, HIGH);
      digitalWrite(MoPin2, HIGH);
      digitalWrite(MoPin3, HIGH);
      digitalWrite(MoPin4, HIGH);
      //delay(1000);
      break;
    case 2:
      Serial.println("Rice Grain Status : Dry");
      Serial.println();
      Servo1.write(180);
      digitalWrite(MoPin1, HIGH);
      digitalWrite(MoPin2, HIGH);
      digitalWrite(MoPin3, HIGH);
      digitalWrite(MoPin4, HIGH);
      delay(15000);
      int frange = map(sensorReading, sensorMin, sensorMax, 0, 3);
      switch (frange) {
        case 0:
          Serial.println("Not Fully Dry : Returning to Initial Drying Phase");
          Serial.println();
          Servo1.write(180);
          digitalWrite(MoPin1, HIGH);
          digitalWrite(MoPin2, HIGH);
          digitalWrite(MoPin3, HIGH);
          digitalWrite(MoPin4, HIGH);
          //delay(1000);
          break;
        case 1:
          Serial.println("Not Fully Dry : Returning to Initial Drying Phase");
          Serial.println();
          Servo1.write(180);
          digitalWrite(MoPin1, HIGH);
          digitalWrite(MoPin2, HIGH);
          digitalWrite(MoPin3, HIGH);
          digitalWrite(MoPin4, HIGH);
          //delay(1000);
          break;
        case 2:
          Serial.println("---Begining Final Drying Phase---");
          Servo1.write(110);
          delay(15000);
          digitalWrite(MoPin1, LOW);
          digitalWrite(MoPin2, LOW);
          digitalWrite(MoPin3, LOW);
          digitalWrite(MoPin4, LOW);
          Serial.println("=========DRYING FINNISHED========");
          Serial.println();
          Serial.println();
          Serial.println();
          delay(10000);
          break;
      }
  }
  delay(1000);  // delay between reads
}

What mechanism do you have to determine the conveyer has made a loop?

Paul