Intestinal parasites, especially tape worms, are caused when the cat grooms himself and licks the larvae (from flies or fleas) ingesting them. "Grains of moving white rice" near the butt are the symptoms, but is not considered life threatening. The third eyelid appearing is a sign of an underlying problem, such as an upper respiratory infection.

You did the right thing by bringing Moglie to the vet. Sounds like he's on the road to recovery. Keep us posted.