Does applescript's 'delay' function work when the computer is asleep?
I doubt that applescript keeps delay during sleep.  I guess what you can do is when you want to start the delay, get the current time, then set a repeated delay, something like as following.  I'll write this in psuedo-code since I'm not too familiar with applescript anymore

startDelayDate = current date
shouldRepeat = yes
repeat while shouldRepeat is equal to yes
    delay(1)
    if (((current date) - startDelayDate)&gt;=yourDelayTime) //You'll have to implement your own date checking method
        //Do your stuff
end repeat