Scripting Reverse Boolean
import bpy
context = bpy.context
scene = context.scene

obj = context.object.copy()

bool_mods = [m for m in obj.modifiers if m.type == 'BOOLEAN']

if len(bool_mods):
    mod = bool_mods[-1]
    if mod.operation == 'DIFFERENCE':
        mod.operation = 'INTERSECT'
    elif mod.operation == 'INTERSECT':
        mod.operation = 'DIFFERENCE'

scene.objects.link(obj)