Switching the preview:
Font.currentTab.previewView().setBlack_(True)
and setting the panel is a bit more complicated:
for plugin in Glyphs.delegate().valueForKey_("pluginInstances"):
if plugin.__class__.__name__ == "GlyphsPreviewPanel":
print plugin.previewView().setBlack_(True)