Scripting - How to create a game property?
There's the object.game.properties collection, but it doesn't seem to have a new method. You can use an operator to create the property, though, and then modify the value:

for ob in bpy.context.scene.objects:
    if ob.name.find("someName") &gt;= 0:
        # Set active object first so operator works on the right one
        bpy.context.scene.objects.active = ob
        bpy.ops.object.game_property_new(type='STRING', name='foo')
        prop = ob.game.properties['foo']
        prop.value = 'bar'


I'm pretty sure the items in the list are kept in the order they are created, so you can also access the most recently-created property with ob.game.properties[-1].