theThe menu is built by javascript and if I remember well it's donein JavaScript in the CORE.js file.
so if If you need to add a new menu item, you are going to have to overrides this file ... notNot cool.
aboutA better approach is to use JavaScript to override the function which creates the menu in Core.js. You will just need to reference your file after the Core.js file and be careful with the defer loading.
About the version display form, the template is defined in DefaultTemplates.ascxDefaultTemplates.ascx
with the id
DocLibDisplayFormVersionToolBar DocLibDisplayFormVersionToolBar
.
I guess you could overrides the default rendering by your own.