Menus let you append (or prepend) draw_functions to them…
def YourFunction(self, context):
self.layout.label(text="Place Your Function Here")
bpy.types.DOPESHEET_MT_context_menu.append(YourFunction)
Check the ‘Addon Add Object’ Template, as it shows how to add a function to a menu (the add_object_button
)