Using Blender with cell fracture and trying to add collision via Python
First thing - you loop through all objects and then run bpy.ops.object.select_pattern() which will change your selection. It would be better to run a loop as for obj in bpy.context.selected_objects: Which will let you select the objects you want the script to alter.

The operator bpy.ops.rigidbody.object_settings_copy() will copy the rigid body settings from the active object to the rest of the selected objects. You don't need to write a script to do this as it is already available. Press T to show the toolbar and under Rigid body tools you will find a button to Copy from Active.



There is an addon called Copy Attributes Menu that you can enable and it will Allow you to copy modifiers from the active object to selected. Unfortunately it doesn't copy the collision settings. You can copy the collision settings individually by right clicking on a value and selecting Copy To Selected. This can be done with many properties.



If you still want to write a script you can start with something like - 

import bpy

for obj in bpy.context.selected_objects:
    obj.modifiers.new(type='COLLISION', name='collision')
    obj.collision.permeability = 0.3
    obj.collision.stickiness = 0.25


For a collision modifier, you can only have one so always using modifier.new() is ok, no matter how many times you run the script. With other modifiers you may want to test whether one already exists before creating a new one.