Wow, most of the time when they get that bad it requires a vet visit. If it's all back in now I'd suggest the following:
- Keep him well hydrated, it's thought that hard, dry urates and feces is one cause of a prolapse.
- Keep him on paper not substrate, and make sure his enclosure is kept scrupulously clean to reduce the chance of infection.
- Don't feed for a few weeks, if there's little or no "output" then that will help give it time to heal up.
- When you do feed offer much smaller meals than normal. Again, you want minimal feces. If he takes f/t then offer the feeders wet to keep his water intake up.
- If it happens again apply a thick paste of sugar with a little water to the area to keep it moist and encourage it to reduce faster.
- Also, not sure what your store policy is, but the customer that buys him will need full disclosure of his medical issues.