If you decide to keep any animal as a pet, you need to be sure you've done your research and fully understand the animal's needs before committing to care for it. First step is to always extensively research your animal.
You shouldn't have fed it rice, especially rotten rice. Since you can't undo this, you need to keep an eye on it over the next few days. Some things to watch for:
Deep retraction (beyond sealing the shell) is a bad sign. It seems good that he's still out and about and moving.
Inactivity is a sign of incorrect temperature or humidity.
If he's moving, climbing, or looking like he's trying to get away/get out, you need to address how you're caring for your snail.
This site addresses many snail issues very thoroughly.
But, I think there are a few things you can and should do in the mean time:
Habitat: You should first address your snail's enclosure. A jar is likely not large enough for a land snail (unless your land snail is very small). I would recommend getting a plastic or glass terrarium. (Make sure the lid seals well, but that there's lots of ventilation.) Snails are also very sensitive to humidity and temperature, so be sure you know the right levels for your type of snail. You may need to invest in a heat pad. The terrarium will also need to be cleaned regularly.
Food: Snails are omnivorous and will eat many things, but you do have to be careful. When feeding the snail, always wash anything you give it to remove any trace of pesticides or other harmful things. Remove any uneaten food within a day, so it doesn't rot or mold. Snails can eat most leafy greens, most vegetables, and many fruits. They can't eat anything with salt, citrus (was he eating the orange you found him on?), or starchy foods (including rice). Never let the food go bad!
Calcium: Calcium is extremely important to a snail's diet. It's what keeps it's shell strong. You can buy calcium supplements to sprinkle on food you provide your snail. A snail needs a constant supply of calcium.
Good luck with your snail! I hope the issues are addressed and you're able to provide him a safe and comfortable habitat.