The answer is to use a commutator. This device prevents the wires from twisting. More importantly it actually allows the coil to keep rotating in one direction!
The one shown is a split-ring commutator. It has two halves, each connected to the power supply, completing the coil circuit. The coil is able to turn smoothly around it.
In the vertical position there is no current as the coil has lost its connections to the commutator. Since the coil was already moving, it keeps turning. Think about riding a bike - stop pedalling and you don't stop moving for quite some time.
Once the coil rotates past the vertical position, it reconnects to the circuit. The difference now is that the direction of the current in the coil is reversed. This results in a change in the direction of the forces on each section of the coil. The coil keeps turning in the original direction!
Summary points: split-ring commutators reverse the direction of the current in the coil each half turn. This allows the motor coil to rotate continuously in one direction.