motor hard stop vs coasting
You are trying to use a mix of delay and  millis

Instead you will want a proper state machine:

void loop(){

    switch (state){
    case GOING: go(); 
       state = WAIT_FOR_COAST; 
       transition = millis();break;

    case WAIT_FOR_COAST: if(millis()-transition &gt; 1000){
            allStop(false);
            state = WAIT_FOR_STOP; transition = millis();
        }
        break;
    case WAIT_FOR_STOP: if(millis()-transition &gt; 250){
            allStop(true);
            state = WAIT_FOR_GO; transition = millis();
        }
        break;
    case WAIT_FOR_GO: if(millis()-transition &gt; 1000){
            allStop(true);
            state = WAIT_FOR_GO; transition = millis();
        }
        break;

    }

}


Remove the delay in go and use a simple if-else in the allStop where parameter == true means hard stop and false means coast.

Another option is to use a extra mosfet to put a resistor across the motor instead of shorting it out (which is what the hard stop will do). That will reduce the breaking torque but defeats the isolation of the board.