Factory Reset or Recovery takes place outside of Windows - - so none of the Windows Power Options Settings will apply - - it can't go to sleep.
Just make sure you perform the recovery with the laptop plugged in to a power socket so it's running off the mains adapter, not the battery.
When recovery has completed, Windows will start but the recovery process will have finished at that point so it doesn't matter if laptop goes to sleep then anyway if you aren't there.