Servo not stopping

The LEDs are running fine and only run when the input is reading something however, the servo runs by its self and not by what the input is saying

#include <Servo.h>

Servo myservo; 

int ledPin = 11;
int inputPin = 2;
int pirState = LOW;
int val = 0;

void setup() 
{
  myservo.attach(9);
  pinMode(ledPin, OUTPUT);
  pinMode(inputPin, INPUT);
  
  Serial.begin(9600);
} 

void active (int action) {
  if (action) {
    myservo.writeMicroseconds(1500);
    for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=1) {
      analogWrite(ledPin, fadeValue);
      delay(15);
    }

    for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=1) {
      // sets the value (range from 0 to 255):
      analogWrite(ledPin, fadeValue);
      delay(13);
    }
  } else {
  }
}

void loop()  {
  active (digitalRead(inputPin));
}

Where do you tell it to stop? Unless you think the delay() function's parameter is the pin. It's actually an amount of time in milliseconds. So you're telling the program to wait 15 milliseconds rather than telling the servo to stop.

sorry wrong code, and it should be running of the motion sensor

#include <Servo.h>

Servo myservo; 

int ledPin = 11;
int inputPin = 2;
int pirState = LOW;
int val = 0;

void setup() 
{
  myservo.attach(9);
  pinMode(ledPin, OUTPUT);
  pinMode(inputPin, INPUT);
  
  Serial.begin(9600);
} 

void active (int action) {
  if (action) {
    for(int fadeValue = 0 ; fadeValue <= 255; fadeValue +=1) {
      analogWrite(ledPin, fadeValue);
      delay(18);
    }

    for(int fadeValue = 255 ; fadeValue >= 0; fadeValue -=1) {
      // sets the value (range from 0 to 255):
      analogWrite(ledPin, fadeValue);
      delay(12);
    }
    myservo.writeMicroseconds(1500);
  } else {
     //whatever else it was you wanted to do
  }
}

void loop()  {
  active (digitalRead(inputPin));
}

Is action retuning a boolean or a 1/0 value? I think there might lie your problem.

Edit:
When you declare the servo, try changing it to SoftwareServo myservo;
I honestly don't know much about Arduinos, but google is my best friend!

When you declare the servo, try changing it to SoftwareServo myservo;

It does not read SoftwareServo myservo;
and its a continuous servo it doesn't matter where it stops