Looks like soapy fun.
As it's a bog standard shaded poll induction motor, there isn't anything to electrically damage other than the coil. Also, as it's an AC motor, there's little chance of electrolytic corrosion of the wire.
If the motor hasn't already dried out (and maybe if it has) I would be tempted to give it a good soak, motor downwards, gearbox up out of the water to flush out as much detergent as possible from the coil and bearings. Maybe do a few refills.
As it's a peristaltic pump, it should be easy to take apart and clean. You probably want to check that no detergent has got into the gearbox. If so, you'll need to get it out and re-grease.
I doubt that the motor winding has actually been damaged (unless the detergent is capable of dissolving magnet wire insulation). I would first try flushing the detergent out (as above) and then give it a good dry, first with a hair dryer to get the surface water off/out, and then a prolonged dry in a warm place.
The detergent may have washed the oil out of the motor bearings, so a little sewing machine oil wouldn't go amiss.