Manipulate BGE logic bricks through python
This is done using the bpy.types.Sensor.link method, e.g.

import bpy

obj = bpy.context.object
sensors = obj.game.sensors
controllers = obj.game.controllers
actuators = obj.game.actuators

bpy.ops.logic.sensor_add(type="ALWAYS", object=obj.name)
bpy.ops.logic.controller_add(type="LOGIC_AND", object=obj.name)
bpy.ops.logic.actuator_add(type="ACTION", object=obj.name)

# Newly added logic blocks will be the last ones:
sensor = sensors[-1]
controller = controllers[-1]
actuator = actuators[-1]

sensor.link(controller)
actuator.link(controller)