Scripting help for Audio Visualizer Tutorial
It is only creating one cube because your for loop is wrong.  In python the indentation is very important.  Note that in the code below, all functions for object creation have been indented to become part of the for loop, so that it is run 25 times, rather than once.

for i in range(0, rows*columns):
    if c == columns:
        r += 1
        c = 0


    bpy.ops.mesh.primitive_cube_add(location =(r*2, c*2, 0))
    c += 1
    bpy.context.scene.cursor_location = bpy.context.active_object.location
    bpy.context.scene.cursor_location.z -= 1
    bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
####
    bpy.context.active_object.scale.x = 0.5
    bpy.context.active_object.scale.y = 0.5
    bpy.context.active_object.scale.z = 5
    bpy.ops.object.transform_apply(scale=True)

    bpy.ops.anim.keyframe_insert_menu(type ='Scaling')
    bpy.context.active_object.animation_data.action.fcurves[0].lock = True
    bpy.context.active_object.animation_data.action.fcurves[1].lock = True


The other errors were since you used bpy.context.active_object.animation_data.action.fcurves[0],lock = True instead of bpy.context.active_object.animation_data.action.fcurves[0].lock = True.  That should be it, just pay very close attention to detail when copying code.  It's helpful if you can find tutorials that include working code, and then modify it yourself, that way you know what changes break it.