Not sure if this is applicable, and it's way before your time here, but there was a user named snicker who had an interesting idea about clipping (with actual good results!). Basically because not all channels were boosted equally, not all channels clipped equally. For example, on a lot of clipped colored lights, the red channel is clipped, or possibly the blue channel, but the green channel retains some detail, which could be used in restoring the shot.
Anyway, not sure if what he did was exactly scriptable, but he produced some impressive results, where previously clipped/crushed data seemed to be restored to bright red lights and I believe also the black "pit" in the death star hangar. Anyway, you might find someone here with more technical detail, but I thought since you're messing with clipping anyway, it couldn't hurt to mention it...