Sorry, didn't read the code.
But:
If you want to "sleep" and wake with one button, then you need to fully debounce the button in both the press and release - you only sleep after the release has been fully debounced, not the press.
Easy when you think it all through ... ![]()