Original: Zeus gave her the gift to be able to take her eyes out to rest, and then put them back in.
Simplified: Zeus then gave Lamia the gift of being able to take her eyes out, so that she could rest.