I need code help for my servo motor

Start by not trying to send the servo to 380 degrees. Why are you using that value ?

The Servo library read() function returns the most recent value written to the servo. It does not take a parameter. If you want to know whether the servo was last commanded to go to a particular position then read it and compare it

if (myservo.read() == someValue)
{
  //do something
}

but as I said some time ago this is not the best way to test whether the door is open or closed