Stepper after homing in setup, Should rotate 1 revolution and stops at home post

Hello, all genius,
here is my setup, Please help me to rotate stepper in void loop also and stop after 1 revolution to home position.

// Define connections
#define PROX_SENSOR      12
#define DIR      8
#define STEP      9
const int red1 = 4;
const int red2 = 5;
const int blue1 = 6;
 
// Direction Variable
boolean setdir = LOW;
 
void homefunction() {
  // Set motor speed pulse duration
  int pd = 4000;
 
  // Move motor until home position reached
  while (digitalRead(PROX_SENSOR) == 1) {
 
    digitalWrite(DIR, setdir);
    digitalWrite(STEP, HIGH);
    delayMicroseconds(pd);
    digitalWrite(STEP, LOW);
    delayMicroseconds(pd);
  }
 
}
 
void setup() {
 
  // Setup the stepper controller pins as Outputs
  pinMode(DIR, OUTPUT);
  pinMode(STEP, OUTPUT);
  pinMode(red1,OUTPUT);
  pinMode(red2,OUTPUT);
  pinMode(blue1,OUTPUT);

  pinMode(PROX_SENSOR, INPUT);
 
  // Home the motor
  homefunction();
 
}
 
void loop() {
 


//Here in the loop also I want the stepper to rotate and stop on the home position with delay (500).






  {
  digitalWrite(red1,HIGH);
  delay(200);
  digitalWrite(red1,LOW);
  delay(200);}
  {digitalWrite(red2,HIGH);
  delay(600);
  digitalWrite(red2,LOW);
  delay(5);}
  {digitalWrite(blue1,HIGH);
  delay(300);
  digitalWrite(blue1,LOW);
  delay(200);}
 
}

Have a look at this Simple Stepper Code

...R
Stepper Motor Basics