I'll tell you how I get worms off bad motors. I simply pound the shaft opposite the worm a bit to expose some of the armature shaft next to the worm. Then I use my Dremel to cut the shaft and free the worm. I place the worm with the shaft facing down on my large vise and use a pin punch to pound out the shaft. Works great.
To press the worm onto to a new motor, you will need to heat the worm and support the shaft on the opposite side of the motor. NEVER use the motor case to support the assembly when pressing on a gear or the flywheel, you must ONLY use the actual armature shaft to support it. It's very easy with little force to ruin a motor by sliding the commutator assembly on the armature shaft if you support it by the motor case.
Worms are difficult to remove/replace, the flywheels are typically very easy.