Matt
Do you mean screen on?Matt
Matt
... Turning off the screen does not necessarily mean the device will go to sleep. For example, if your using an audio player and the screen is off the device is not going to go to sleep because the audio player will have a wakelock on which will keep the device from going to sleep. ...
If you tried to have Tasker react to some message about the device going to sleep Tasker's activity would stop it from going to sleep. If the device is sleeping then Tasker can't react to anything.
Not that I am aware of.