This is how it works. Instead of limit switches you can use magnetic reed switch for door close and open. If sliding door you need two switches. Another method is to calculate the time taken for the door to open. Say you need 5 sec to open the door slowly then you use a timer so that the motor rotates for 5 sec in each direction for either opening or closing the door. This way you don't need the switches. You have to manually find out at what speed the door has to open or close. You can use a single tact switch which cycles a counter in code in three steps and the 3 values of counter can select three speeds for opening and closing the door.
You can use a Bi-Directional DC motor and use PWM and Timer Interrupt to precisely open and close the door. PWM duty should slowly rise and slowly fall like 0, 10, 20, 30,...80...70, 60, 50....0. This way the moment the door opens it starts slowly opening the door and gradually speed increases and then when the door comes nearer to end point the speed falls. You need a feed back from motor shaft like if motor is rotating or not. I just found another way to control the door. use a hall sensor or IR sensor to count the no. of pulses needed for opening or closing the door. Use pressure sensors or IR sensors to detect presence of person near door which starts the opening and closing sequence. the no. of times the shaft is rotated is counted by feeding pulses to T0CKI pin of PIC. If the opening/closing of door and hence rotation of motor is forcibly stopped then there will be no pulses and the motor continues to runs after the force avoiding the opening or closing of door is removed.