Dynamic menu creation : how to get the selection?
The menu invokes an operator and this operator would need to receive the filename as a parameter. 

I assembled a few lines (sorry for not renaming the classes) I'm sure this can be improved. 

AnimMenu - iterates over all loaded text files and add them to a manu in the main header. The files name is handed over by a StringProperty.

AnimOperator - Is invoked when a menu item has been selected it reads the value of the property and shows how the filename is received and how to retrieve files content.

import bpy

text=""

class AnimOperator(bpy.types.Operator):
    bl_idname = "object.anim_operator"
    bl_label = "Pose Anim Operator"

    text_name = bpy.props.StringProperty(name="anim_text_name")
    @classmethod
    def poll(cls, context):
        return context.active_object is not None

    def execute(self, context):
        print("invoked script %s" % text )
        print("invoked script name=%s" % self.text_name )
        txt = bpy.data.texts[ self.text_name ].as_string()
        print("do something with script")
        return {'FINISHED'}

class AnimMenu(bpy.types.Menu):
    bl_label = "Anim Menu"
    bl_idname = "OBJECT_MT_anim_menu"

    def draw(self, context):
        layout = self.layout
        for txt in bpy.data.texts:
            props = layout.operator("object.anim_operator", text=txt.name)
            props.text_name = txt.name


def draw_item(self, context):
    layout = self.layout
    layout.menu(AnimMenu.bl_idname)


def register():
    bpy.utils.register_class(AnimOperator)
    bpy.utils.register_class(AnimMenu)
    bpy.types.INFO_HT_header.append(draw_item)

def unregister():
    bpy.utils.unregister_class(AnimMenu)
    bpy.types.INFO_HT_header.remove(draw_item)
    bpy.utils.unregister_class(AnimOperator)

if __name__ == "__main__":
    register()