Motor running issues

Hi, I'm trying to control a 9v-12v, DC motor. I got the motor to run. But when I transferred that same code into my voice commanding code it wouldn't spin.
First i will post the original code:

//L293D
//Swing Motor (Big motor)
const int motorPin1  = 5;  // Pin 14 of L293
const int motorPin2  = 6;  // Pin 10 of L293
//Toy Motor (Small Motor)
const int motorPin3  = 10; // Pin  7 of L293
const int motorPin4  = 9;  // Pin  2 of L293

//This will run only one time.
void setup(){
 
    //Set pins as outputs
    pinMode(motorPin1, OUTPUT);
    pinMode(motorPin2, OUTPUT);
    pinMode(motorPin3, OUTPUT);
    pinMode(motorPin4, OUTPUT);
    
    //Motor Control - Motor A: motorPin1,motorpin2 & Motor B: motorpin3,motorpin4

    //This code  will turn Motor A clockwise for 2 sec.
    digitalWrite(motorPin1, HIGH);
    digitalWrite(motorPin2, LOW);
    digitalWrite(motorPin3, LOW);
    digitalWrite(motorPin4, LOW);
    delay(10000);

My voice activated code:

#include <HardwareSerial.h> 
#include <Arduino.h> 
#include <Wire.h> 
extern HardwareSerial Serial1; 
extern HardwareSerial Serial2; 
char incomingByte; 
char incomingByte1; 
//Speaker 
int Speaker = 15; 
int Swing = 16; 
int RedLED = 12; 
int MotorToggle = 30;

//L293D 
//Swing Motor (Big motor) 
const int motorPin1 = 5; // Pin 14 of L293 
const int motorPin2 = 6; // Pin 10 of L293 
//Toy Motor (Small Motor) 
const int motorPin3 = 10; // Pin 7 of L293 
const int motorPin4 = 9; // Pin 2 of L293 
int EN1 = 3; // Pin 1 of L293D IC, D6 Pin of NodeMCU (controls the speed) 
void setup() { 
 //Set motor pins as outputs 
 pinMode(motorPin1, OUTPUT); 
 pinMode(motorPin2, OUTPUT); 
 pinMode(motorPin3, OUTPUT); 
 pinMode(motorPin4, OUTPUT); 
 pinMode(EN1, OUTPUT); //Where the motor is connected to 
 Serial.begin(115200); 
 Serial2.begin(115200); 
 Serial.println("Ready for commands"); 
} 
void loop() { 
 ///// 
 if (Serial2.available() > 1) { 
 // read the incoming byte: 
 incomingByte = Serial2.read(); 
 incomingByte1 = Serial2.read(); 
 Serial.print ("Received data = "); 
 Serial.print(int(incomingByte) , DEC); 
 Serial.println(int(incomingByte1) , DEC); 

 if(incomingByte == 0)
 {
  Serial.print("Test Successful");
    digitalWrite(motorPin1, HIGH);
    digitalWrite(motorPin2, LOW);
    digitalWrite(motorPin3, LOW);
    digitalWrite(motorPin4, LOW);
    incomingByte = 0;
    Serial.println("I received: ");
    Serial.println(incomingByte1, DEC);
 }
  if(incomingByte == 1)
 {
  Serial.print("Turn off Successful");
    digitalWrite(motorPin1, LOW);
    digitalWrite(motorPin2, LOW);
    digitalWrite(motorPin3, LOW);
    digitalWrite(motorPin4, LOW);
    incomingByte = 0;
    Serial.println("I received: ");
    Serial.println(incomingByte1, DEC);
    
 }

Here is a schematic of my wiring:

What does the serial output show?

It might be worth putting the motor turning code into setup to confirm that your wiring/power are still ok.

It doesn't run when i added the code below to my setup

digitalWrite(motorPin1, HIGH);
 digitalWrite(motorPin2, LOW);

I have two motors, a small 6v motor that will run but the bigger motor won't run.

Do you have data sheets for the motors that will list the stall current of each motor?

What is the voltage and current capability of the motor power supply?

I got the motor to work for some reason, since the enable pin of the chip l293D was working it wouldnt process the code. But once I got rid of the enable pin it worked.
Any reasons why that would be?

The bigger motor probably wants way more current than the L293D can provide. Motors take loads of current, the L293D is rated at 0.6A which is not very much at all, enough for a tiny toy motor.
A MOSFET H-bridge with a good current rating may be needed for the larger motor - what motor is it BTW?