Sleep screen stops macro

If I go to the corner and sleep the screen, the macro stops, but instead, if I turn off the screen, the macro continues.

Check your System Preferences "Battery" (or "Energy Saver" for older OSes) pane and make sure "Prevent your Mac from sleeping automatically when the display is off" is ticked.

I was doing that and would turn off the monitor, which I went back to, but thought sleeping the screen would be simpler. It seems to me that if the macro works with the power off to the screen, it also should when putting the screen to sleep. Looks like a bug to me.

Not a bug, it's two different events -- one happening on the host ("Display sleep"), and one on a peripheral (power off).

It is counter-intuitive -- you'd expect turning off the display to equal "when the display is off"! -- but it can come in handy. For example, if you have a 45 minute macro that doesn't need interaction you could leave "Prevent computer..." unticked, set "Turn display off after..." to an hour, start the macro and then turn off your monitor. The macro will still run just as if the monitor was turned on, finish, and after the hour was up your computer would "turn off" its graphics card which would trigger sleep.

I don't know if the observed behaviour extends to the current external Apple displays, though -- or if they even have an "Off" button!