How to automatically reverse the direction of a motor without human intervention?
Most hobby brushless ESCs can be reflashed with an open source firmware, which could be trivially modified to implement the auto reversing behavior.

If an MCU based brushless motor drive can operate in both directions or only one is effectively a software function, so to an extent it does not really matter if the original firmware was "airplane" or "car" style.

That said your application might be a better fit for a stepper motor which is a sort of brushless motor optimized for open loop use in discrete increments of movement.  If you want to use a traditional brushless motor, you'd probably need one with hall sensors (and compatible driver) and some sort of mechanical reduction such as a timing belt or even 3d printed herringbone gears.  Speaking of 3d printers, the drive electronics for those are typically Arduino-based open source multi-channel stepper motor controllers, albeit ones targeted at relatively small motors.

The mechanical engineering of your project is going to require as much more more attention as the electrical, but is not strictly speaking on topic here.

Sometimes it's best to go looking through the world and find some existing machine that does something like what you need, and either see how it works, or even adapt it for your purpose.