That must have made for an exciting time. Was the jack slipping straight forward or back, or was it pivoting to the side? If straight forward or back it was probably the rear chocks slipping on the ground. If pivoting to one side did you have blocks both front and rear on the tires? That might help stop a pivot as one side has to move forward as the other side is moving back.
As far as preventing I do two things.
- Make sure the blocks are well seated before unhooking
- Never unhook the safety chains until the trailer is unhitched and verified stable
To seat the blocks I use a helper. Have them place a block behind the wheels on both sides of the trailer. Then have them stand back while I back the trailer slightly up onto the rear blocks I use wooden blocks and back up pretty aggressively, with plastic blocks you have to be more gentle so they don't crush. Once on the blocks I mash the brakes and have the helper place blocks in front of the tires on each side and kick them up tight against the tread. After the helper steps back out of the way I put the truck in neutral and let is roll off the rear blocks and into the front blocks so the tire is cradled firmly in a V. This both anchors the blocks fairly securely, and it also reduces movement in the trailer when people are moving around.
If I'm using plastic leveling blocks under the tires I always use my homemade tire clamp to lock the wheels on that side of the trailer. I still use the blocks on that side as well, but I don't really trust them as chocks tend to slip on the plastic blocks.