You'd have to do some testing to see if the method I described indeed renders the scene twice. If it does, you'll have to write a small plugin as Matt suggested.

Such a shadowmapping script has been written and it can be found on the wiki (link at the top/botom of this page). Here it is: link.