Script version.

Un-Extrude along face normals
- Finds the average normal of all selected faces.
- Finds the average edge length of extruded edges.
- Translates all vertices back
- Removes Doubles. (From the collapsed edges)
In edit mode select the faces, then run script.
import bpy
import bmesh
from mathutils import Vector
ob = bpy.context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
faces = [f for f in bm.faces if f.select]
verts = set(v for f in faces for v in f.verts ) # or from selected verts
edges = [e for v in verts for e in v.link_edges
if not e.select ]
norm = (sum((f.normal for f in faces), Vector()) / len(faces)).normalized()
norm.negate()
d = sum(e.calc_length() for e in edges) / len(edges)
bmesh.ops.translate(
bm,
verts=list(verts),
vec=d * norm,
)
bmesh.ops.remove_doubles(
bm,
verts=[v for e in edges for v in e.verts],
dist=1e-5,
)
for f in faces:
f.select_set(True)
bmesh.update_edit_mesh(me)
Notes
An improvement would be to find all the selected face islands within the selection and "unextrude" on an island by island basis.
This is "unextruding" an extrusion along face normal. Instead of the average face normal, the vector defined by any (or an average of all) edges would be a better fit.
Any direction un-extrude

After extruding the created extruded edges will (AFAIK) all be the extrusion vector.
import bpy
import bmesh
from mathutils import Vector
ob = bpy.context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)
faces = [f for f in bm.faces if f.select]
verts = set(v for f in faces for v in f.verts ) # or from selected verts
edges = [e for v in verts for e in v.link_edges
if not e.select ]
v0, v1 = sorted(edges[0].verts[:], key=lambda v:v.select)
bmesh.ops.translate(
bm,
verts=list(verts),
vec=v0.co - v1.co,
)
bmesh.ops.remove_doubles(
bm,
verts=[v for e in edges for v in e.verts],
dist=1e-5,
)
for f in faces:
f.select_set(True)
bmesh.update_edit_mesh(me)
Added a test on Suzanne. The remove doubles has effect of unselecting a face depending on which edge vert was removed.... have updated script to restore selection