I've found a little trick to get a menu and add an item in the same script or another one.
In the same script, you can use the function getMenu() in another function and put .addItem() behind.
Main menu (menu.gs)
function getMenu() {
return menu = SpreadsheetApp.getUi()
.createMenu('Main menu')
.addItem('Title', 'function');
}
function onOpen() {
getMenu().addToUi();
}
function onInstall() {
getMenu().addToUi();
}
Also, with another script, you can import it as a Library and use it like before.
Another menu (menu2.gs / Where Service is menus.gs imported by Libraries)
function getMenu() {
return Service.getMenu()
.addItem('Another Title', 'anotherFunction');
}
function onOpen() {
getMenu().addToUi();
}
function onInstall() {
getMenu().addToUi();
}