Sounds like a transparent xscreensaver module would do the trick. I haven't looked at xscreensaver code in a while, but I don't think it would be too difficult, and I can definately see applications for something like this.
On actual review of how xscreensaver works, this may actually be a very difficult way to implement this. It may be simpler to write something that catches all mouse/kbd signals before they get through...