How can I change the 3D View's background color to something different for each mode?
Set World Background on and run this script via Blender text editor.



import bpy

Modes = {'OBJECT':(1, 0, 0),
        'EDIT':(0, 1, 0),
        'SCULPT':(0, 0, 1),
        'VERTEX_PAINT':(1, 1, 0),
        'WEIGHT_PAINT':(1, 0, 1),
        'TEXTURE_PAINT':(0, 1, 1)}

def my_handler(scene):
    mode = bpy.context.object.mode
    scene.world.horizon_color = Modes[mode]

def register():
    bpy.app.handlers.scene_update_post.append(my_handler)

def unregister():
    bpy.app.handlers.scene_update_post.remove(my_handler)

if __name__ == "__main__":
    register()