Use a changeover switch that does not have a "snap" action.
Connect the normally open and normally closed contacts together for one side of the circuit & use the common as the other.
That gives the inverse of what you are asking for, a switch closed at either extreme and open in the middle - but to trigger something electronic, ground one side and add a pull-up resistor to the other and you have a signal than will go "high" part way through the movement.
Or, two separate switches with the plungers adjusted to different lengths or in different positions, so they operate at different angles of the door travel.
Wire them in series to break the circuit, so one breaks as the door gets near fully closed and the other as it's wider open. The two would both be on only at the middle of the movement range.
Other than that, you probably need to make one yourself.
eg. a small magnet in a tube with a spring behind it and a plastic pushrod in front, with a magnetic reed switch attached to the side of the tube so it operates only at the bid point of the magnet movement.
Or the switch on an arm mounted to the door frame & the magnet set in the top of the door; a bit like an old style shop bell that sounded as the door opened.
A rotary switch arranged with a linkage so it turned with the door movement?
Use one or two contacts that close part way through the total travel range.
You can buy the electrical switch version of a shop door bell device!
eg.
They mount to the frame just above the door at a suitable distance from the hinge, so the door lifts the "cam" briefly as it opens or closes.