Motor that allows threaded rod to pass through
There are "hollow shaft motors" similar to these. The inside of the shaft can be threaded (or a nut can be fitted inside) to make the motor itself travel along a matching threaded rod.