Python: Apply object operator to dupli objects
This uses selected_editable_objects, You can find out which attributes are used by passing in a Python context, and then check the terminal for where each requested attribute is printed.

(Yes, we know this isnt an ideal way to design the API, however this is internal C code which defines which context variables are used).

import bpy
from bpy import context

# flat or smooth
flat = True

# use a 'set' to avoid duplicates, can convert into a list after.
selected_editable_objects = set()

for obj in context.scene.objects:
    if obj.dupli_type == 'GROUP':
        group = obj.dupli_group
        if group:
            for dob in obj.dupli_group.objects:
                selected_editable_objects.add(dob)

context_py = context.copy()

context_py["selected_editable_objects"] = list(selected_editable_objects)


if flat:
    bpy.ops.object.shade_flat(context_py)
else:
    bpy.ops.object.shade_smooth(context_py)




Note: this would be more efficient to de-duplicate based on the object data, since its possible many objects reference the same data. But for the example above, its simpler to just take unique objects.