I’m sorry, but I’m not understanding how to insert a menu command at a specific index (per the original post) with self.layout from the doc link you sent. My other research shows people overriding the menus’ draw functions with a lot of code.
You aren’t appending menu items, you’re appending function pointers. So, while you are seeing 30 lines in a menu, it is likely a single function drawing them all. Short of rewriting the menu with your item where you want it to be, it isn’t possible.
yep, You can append and prepend easily, index is not available.
You can try doing things like: copy original source of class bpy.types.TOPBAR_MT_file, edit its draw function and re-register, or catch and filter draw function calls, but it is uphill battle.