hall sensors to controll motor

hi. im using arduino uno r3, motor drive shield tle94112el, geared motors and, remote and hall sensors. i wanna rotate the motor 120 degrees by pressing a button on the remote, and when one of the three magnets is close to the hall sensor, i want the motor to stop. the code i attached here works but just for one movement cose the magnet is still close to the sensor and doesnt let it move. i tried using delay bet this delay was aplied betwenn the moment i pressed the button an the moment of the activation of sensor, as i wanted, but was also aplied between the moment when sensor detected the magnet and the moment when the motor stopped and introduced a semnificative error. please, any ideas how can i fix this?

#include <TLE94112.h>
#include <Tle94112Motor.h>
#include <IRremote.h>

#define sound 0x55
int RECV_PIN = 2;
int hallSensorPin = 3;
int state ;  

Tle94112 controller = Tle94112();
Tle94112Motor motor1(controller);

IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
    pinMode(hallSensorPin, INPUT);
   irrecv.enableIRIn();
   controller.begin();

  motor1.connect(motor1.HIGHSIDE, controller.TLE_HB1);
  motor1.connect(motor1.LOWSIDE, controller.TLE_HB2);
  motor1.setPwm(motor1.HIGHSIDE, controller.TLE_PWM1);
  motor1.setPwmFreq(motor1.HIGHSIDE, controller.TLE_FREQ200HZ);
  motor1.begin();
}
void loop()
{

  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
    if(results.value==sound||results.value==0x55||results.value==0x2103||results.value==0x837||results.value==0x37){
 
  motor1.start(-63);
}
 }
  state = digitalRead(hallSensorPin);
 if (state == LOW){
  motor1.coast();
  }
  }

This is a fairly common logical error

 if (state == LOW){
  motor1.coast();
  }

Rather than have the motor coast when the state is LOW you should get it to coast when the state changes from HIGH to LOW. That way it will be able to move on when it gets the next instruction. Something like this

previousState = state;
state = digitalRead(hallSensorPin);
if (state == LOW and previousState == HIGH) {
   motor1.coast;
}

...R