Ok, well going back to your original question, which I don't fully understand:
I have been trying to perform a sleep function in repeat using the void loop function.
The code you posted, after being prompted, does not show the loop function. Nor the setup function. So I can't say if you are putting the processor to sleep in an appropriate way or not.