Python script for "Cursor to Active"
If a 3d view is not in local mode then bpy.ops.view3d.snap_cursor_to_active() is the equivalent of

context.scene.cursor_location = context.active_object.location


Could also just get the location from the lamps in the scene

import bpy

context = bpy.context
scene = context.scene

lamps = [o for o in scene.objects if o.type == 'LAMP']

for l in lamps:
    # add sphere
    bpy.ops.mesh.primitive_uv_sphere_add(location=l.location)
    # unlink from scene (could bpy.ops.delete or bpy.data.remove )
    scene.objects.unlink(l)


or pre select the lamps and use

lamps = context.selected_objects