How to select (command A) an object in the scene
To select objects that are currently visible in the 3dview, which means they are on any visible layers, you can set the select property of visible objects.

for obj in bpy.context.visible_objects:
    obj.select = True


If you want to check every object on layer[0] and still catch ones that may be hidden you can test the layer value of each object.

for obj in bpy.data.objects:
    if obj.layers[0]:
        obj.select = True


After deleting and deselecting objects you may also want to ensure that the active object is valid.

bpy.context.scene.objects.active = bpy.context.selected_objects[0]