Can anyone help me identify the motor/mechanism used in this?
The motor appears to be a very standard 9V motor, presumably using a conversion cable as the switch is a PF one.

As for how it stops, it's not that complicated: when activated,the mechanism pushes the switch back to its "off" position, which is what makes the motor stop. You'll probably think the motor direction is reversed and that's what makes the arm go back in the box, but that's not the case: the motor is actually off and what makes the arm go back is simply its own weight.