Okay, first things first. A small crack, they will fix by themselves. A big bad one, like a hole, will need your help. The following is what I've done on a mystery shell and it worked. On the other hand, we must be prepared for the snail to not make it through the trauma of damage.
You can fix the shell by supergluing an eggshell piece over the crack, so get an egg and superglue. Wash your hands. Dry off the snail, push it gently back in her shell.
Break off a small piece of eggshell with membrane attached (that's the thin transparent skin lining the shell). Put a small bit of glue on the edges of the eggshell chip. You want to be sure that NO glue touches the snail itself - only the snail's shell. Press the chip with glue gently down over the hole. The eggshell piece may crack. You can glue another, tinier piece over that. The object is to make a barrier so the snail isn't coming out any more.
Let dry for about 15 minutes and put the snail back in its tank. It's probably in shock and may take some time to recover and start moving. Putting down some food after an hour may stimulate movement.
Again, sometimes they don't survive the trauma.
Attached is a wonderful video of a woman with a calm voice doing this procedure. She uses a file for the snail shell edges, but I don't: I just don't feel right using a file that close to their sensitive skin. Your choice what you feel comfortable with.
I hope this video plays - if not, for some reason (the attachment is really long), pose your question online ("how to repair cracked mystery snail shell") and she should come up pretty fast, as she's soothing and does a good job. Her video is about 9 minutes long.
Good luck and let us know how your mystery makes out.