The calculation would not be hard but more info is needed.
Firstly, performing the motion in 20 ms using a time-optimal trajectory means accelerating for 10 ms and braking for the other 10 ms.
During acceleration the gizmo moves 2.5 cm (half way), and from the equation S = at^2 we get acceleration by simple rearrangement:
a = 0.025m / 0.0001s^2 = 250m/s^2 ~25.5g
Next you need to know the mass to accelerate at that rate. From that you can calculate the force needed (F = ma), and then from that the motor torque required to generate that much linear force over the drivetrain.
The acceleration being that high, i don't think you will find an easy solution although i don't consider it impossible. You can forget all run-of-the-mill iron steppers because their self-mass and inertia will preclude that kind of acceleration. You would need a disc rotor or basket rotor motor, and those babies are neither common nor necessarily cheap. Kollmorgen at least makes basket rotor servos that are designed for this kind of application. But they have their price...