If you want to take advantage of functionality that is provided my menu commands you can use EditorApplication.ExecuteMenuItem in your editor scripts to execute them.