Yes, frogs and toads sleep with their eyes closed. They are equipped with moveable lids that protect their eyes from dust and dirt. Snakes , like all reptiles do sleep. They are capable of doing this quite soundly despite the fact that they have no moveable eyelids. Moving your hand in front of the face of a sleeping snake will often not cause it wake up for several seconds.
Snakes are perfectly capable of recognizing non-moving prey.
Their eyesight is rather poor, but other senses help them to recognize prey. The most important sense is their sense of smell. They may use it to recognize stationary food items. They pick up particles in the air on their tongues and an organ beyond the roof of the mouth analyzes these particles. Some snakes are capable of detecting body heat of prey items.