I would guess that the USB HID device that the digispark says it is when pretending to be a keyboard probably doesn't set the right bits for the OS to want to keep the USB port active when it goes to sleep - either that or the clock isn't going, so the USB emulation on the digispark gives up when the computer goes to sleep. I don't know what settings would need changing (if it is possible to fix in software).