I was having the same problem with my Mighty Mouse -- the green light would blink twice for about a minute, then go dark, and the mouse didn't work at all and the Bluetooth set up tool wouldn't even find it. Frustrating.
I went and downloaded Steer Mouse 3.7 (
http://www.apple.com/downloads/macosx/drivers/steermouse.html), installed it, restarted, and now my mouse is working again. I have no idea if it was the software or simply the re-start. I'm just enjoying being able to mouse again. Not sure if this helps with the keyboard problem (this hasn't happened to me yet...knock wood), as I don't know if there's a new keyboard driver, but thought I'd share.
Good luck,
Kate