I was wiping free space on a 16GB USB flash drive and CCleaner didn't stop computer going into Sleep mode while the task was still running.
Another privacy eraser program has a feature where Sleep mode can be disabled while the task is running. Please look at he attached snapshot. I think you should adopt a feature like that in your program.