I'm pretty sure there's a D-Bus message for inhibiting the screensaver.