Considering the comments from here, I reduced the code as follows, but still the question remains: can I execute the scripted module based on the following code? How would I do that?
// get module and its widget
qSlicerScriptedLoadableModule* scrModule = static_cast<qSlicerScriptedLoadableModule*>(qSlicerCoreApplication::application()->moduleManager()->module("SurfaceToolbox"));
vtkSlicerScriptedLoadableModuleLogic* moduleLogic = vtkSlicerScriptedLoadableModuleLogic::SafeDownCast(scrModule->logic());
// create scripted module node
vtkMRMLScriptedModuleNode* scrNode = vtkMRMLScriptedModuleNode::SafeDownCast(scene->CreateNodeByClass("vtkMRMLScriptedModuleNode"));
scene->AddNode(scrNode);
// set parameters
scrNode->SetParameter("connectivity", "true");
// TBD: set input/output nodes
// TBD: start execution