Arduino diy pellet burner controller

Hello i am New to arduino programming and i need some help. I have made a diy pellet burner and i want to make a controller for this with arduino. I want the following things.

If arduino reads voltage 5v at pin1 then do something once and then do something else in a loop. But when arduino reads voltage 0v then do something else. How can i write this code? Thanks in advance

bool firstRun = false;
byte inputPin = 1;  //used by Serial, you may want to use a different pin.


void setup()
{
 pinMode(inputPin, INPUT);
}

void loop()
{
 int value = digitalRead(inputPin);

 if (value == HIGH)
 {
   if (firstRun == false)
   {
     doOneTimeFunction();
     firstRun = true;
   }
   else
   {
     doLoopingFunction();
   }
 }
 
 if (value == LOW)
 {
   firstRun = false;  // if you want to do the one time function again when input goes HIGH
   do0vFunction();
 }
}

void doOneTimeFunction()
{}

void doLoopingFunction()
{}

void do0vFunction()
{}

Edit: added code tags

Thanks my friend