It's not an easy problem to solve because most solutions hurt the stepper's ability to shed heat. If you enclose a stepper in an aluminum box say, you are trapping it in there with the heat it gives off. This raises the ambient temperature causing the motor to run hotter than it otherwise would and put out less torque than it otherwise would.
If you can manage to put a fan on the enclosure without compromising its seal you'll have protected the motor while letting the heat out.
A second way: Mount the stepper so that the front opening is concealed by the motor mount and coupling/pulley cover. Use heatsink compound to seal where the motor and mount meet. Then brush 5 minute epoxy all over the outside of the laminations including where they meet the end bells. Brush some over the grommet and exit of the leads. After it sets cover the back opening with duct tape. This method will hurt heat dissipation slightly but if coolant is hitting the motor it will of course cool the motor as well.
Chips aren't likely to enter a stepper but dust and abrasives can get in through the bearings.