Script changes to driver expressions and variables
import bpy
context = bpy.context
scene = context.scene

for obj in scene.objects:
    mesh = obj.data
    if not mesh or not hasattr(mesh, "shape_keys"):
        continue

    # shape key collection
    shapekeys = mesh.shape_keys

    # animation data
    ad = getattr(shapekeys, "animation_data", None)    
    # no animtion data no drivers
    if not ad:
        continue

    #select the driver part of fcurves in drivers list
    drivers = [fc.driver for fc in ad.drivers]

    for d in drivers:
        #variables of type distance
        vars = [v for v in d.variables if v.type == 'LOC_DIFF']
        for v in vars:
            # set the target 2 to obj that has driver.
            v.targets[1].id = obj