Hey there, if the computer is awake, macros will continue to execute if they're on a periodic or time of day trigger.
That being said I don't know if macros themselves would prevent the computer from sleeping but that would depend greatly on what the macro is designed to do. None of my 956 macros prevent my computer from sleeping (set to 30 minutes) even though some execute at 15 minute intervals.
Either way, if you want to ensure a macro doesn't fully execute if the screensaver is running, you can use the simple action(s) below. What it does is check to see if the screensaver calculation returns true (indicating it is running), and if it does, it cancels the macro. Note that this will not prevent the macro from being triggered, but it should prevent it from continuing past this point. Simply put it at the beginning of the macro(s) in question.
Likely other folks who are more knowledgeable than I will chime in with more info too.