You can use the built in screen saver that comes with XBMC. The options are all in
Settings -> Appearance Settings -> Screensaver. Although there is a way to actually switch off HDMI, I think that would kill sound and video.
The screensaver will only kick in if video is not being played. Although not having my RPi with me right now, I cant test this. But I'm fairly sure.
Here are the settings and what they mean, there are also some workarounds there.
Allows you to set the amount of idle time required before displaying the screensaver.
Chooses the screensaver. Note: When fullscreen video playback is paused, or a dialog box is active, XBMC will force the "Dim" screensaver. To avoid potential worries of plasma screen burn-in, set the Dim screensaver fade level to 0%. Old versions of XBMC could only select down to 10% via the settings screen; this can also be accomplished by adding an entry to advancedsettings.xml for <screensaver><dimlevel>0</dimlevel></screensaver> (this will remove the Fade Level control from the settings screen altogether).
Allows control of such things as Screensaver dim level which controls how much the screen dims when the screensaver is set to dim mode and Slideshow folder, which determines what pictures to use when the screensaver is set to Slideshow mode.