How to select freestyle style module programmatically?
You will most likely want to enable freestyle in your render layers settings

bpy.context.scene.render.layers["RenderLayer"].use_freestyle = True


To add a module and set the script you can use -

#open freestyle style module
text_block = bpy.data.texts.load(PathToModuleHere)

#add freestyle style module
freestyle_module = rl.freestyle_settings.modules.new()

#set the script to use
freestyle_module.script = text_block