Is there a Blender Python UI code to draw a horizontal line or vertical space?
The definitive place for UI examples is the UI cookbook. The layout templating syntax hasn't changed much since the early 2.5 releases.

There is layout.separator() for a subtle space between consecutive items. The vertical space is added automatically if multiple items appear on one row.

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout

        scene = context.scene

        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")        
        layout.row().separator()
        row = layout.row()        
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")                
        layout.row().separator()
        row = layout.row()        
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")




Or for a more defined delineation, one might use layout.box()

def draw(self, context):
    layout = self.layout

    scene = context.scene

    box = layout.box()
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")        

    box = layout.box()
    row = box.row()
    row.label('some label')
    row = box.row()        
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")                

    box = layout.box()
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")




A vertical split using box and column. You might struggle with this, this is normal.

def draw(self, context):
    layout = self.layout

    scene = context.scene

    col = layout.row()
    split = col.split(percentage=0.5)
    box = split.column().box()

    row = box.row()
    row.label('some label 1')
    row = box.row()        
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")        

    box = split.column().box()
    row = box.row()
    row.label('some label 2')
    row = box.row()        
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")