If you are dropping the door free fall, then it stops when it hits the ground.
For stopping the motor when lifting the door, the you will want to place a limit switch to
the motor. When the door closes, it hits the switch, or a rod that triggers the switch that
will cut power to the motor.
A single pole, double throw micro switch should work.
When the door is closed, the motor is disconnected.
Once you drop the door, the switch will be released, and allow
power to the motor. Once you power up the esc, the motor will
wind the chain till the the door reaches the closed postion, triggering
the switch and cutting power between the esc, and the motor.
:)
I just ran a direct servo rod to the base of the door, and had plenty of throw
from a standard servo to open and close the door.