There are a couple of ways to automatically control a reverse loop. One way is with relays. Another which I use is with AC auto reverser boards. I used the PSX-AR-AC boards, there are 4 reverse loops on my layout. These boards are heavy duty versions of their DCC boards. They detect the short circuit caused by the pickup wheels crossing the isolation gap and instantly flip the polarity of just the reverse loop section. They work in any direction and are independent of turnout point position.
The reverse loop needs to be as long as the train unless there are no illuminated or action cars in any of the trains. That is unlikely. It looks like the way to achieve that length is to: 1) put a gap in both rails at the lower red line in your picture, 2) put a gap at the end of the straight leg of the upper turnout, not in the divergent leg where it is shown, then 3) put a gap in the rails several track sections up the main line from the point side of the turnout to gain length in the controlled section. It is ok but not ideal to make the controlled section this way. Were it my layout I would find a way to move that upper right turnout further up the main line, having 3 parallel tracks for a distance of the longest train. Since I run 20 car freights and 10 car passenger trains my reverse loops are long enough to hold those trains.