Programatically adjust Unity build target

I have some code that builds a StreamedScene, and find it rather annoying that running this code assigns my Unity build target to a webplayer. Can I programatically detect the current editor build target, then reset it back to that after running the streamedscene build code?

Cheers for 3.2! Unity team just added this: http://unity3d.com/support/documentation/ScriptReference/EditorUserBuildSettings.SwitchActiveBuildTarget.html