The plunger has two lugs next to each other on one side of bottom the circumference to allow for horizontal lock when folded and an angled lock when extended. The plunger rotates with the stock. A ring fixed into the lower has appropriately spaced and located recesses to fit the lugs when they are rotated into position to go into lock for each position.
Vertical looseness of the stock can occur as a result of the fixed ring wearing and not being tightly located and anchored. Both the lugs and the fixed ring recesses wear over time and the fit opens up allowing play. The plunger has to move freely in and out so there will be vertical play in it's fit through the stock arm hinge.
Finding a replacement plunger and fixed ring that mesh perfectly without play is not possible without great expense to acquire enough of each to do a mix and match fit. New plungers and fixed rings are being made and sold, but the same issue applies with buying enough of them to find a set that will mesh tightly. Then there is the fit trying to get a play-free fit of the plunge in the stock arm boss and the fit of the fixed ring in the upper which will also be a crap shoot.
Some MPs have sufficient friction in the compression of the hinge parts to create stiffness in the rotation of the stock into extended position which mitigates the vertical play enough to reduce the annoyance. Finding an appropriate sized and thickness shim washr or making and fitting few to fit to the offside hinge boss so that when the stock is assembled and the retaining pin pushed through, there is enough compression to create the friction to dampen the play. This can be done and is really the only fairly inexpensive path to a realistic improvement that I know of. I have done a couple and it is a lot of work to do as the stock cannot be removed without also first removing one side of the hinged buttplate and then complete reassembly to fit each shim to determine which one will, do what is required.
Really bad play can be reduced with replacing the parts but achieving very little or no play is very difficult.
The best of the many MP40s I've handled had very slight play and I doubt a new gun was any better. The design is not capable of entirely eliminating play as there are too many parts in the system and then through repeated stress on the rather small locking parts significant wear leads to excessive play. FWIW