Thanks for the detailed explanation. This helps a lot to make the game run in editor mode. And this may be very helpful for many scenarios.
In my case, I don't need to run the whole game in the editor. What I need is to run the game normally in the run window. And then trigger a method of one of my scripts from a custom editor button. Just for testing/debugging purposes. For this method only.
Now that I am writing this, maybe the easiest way is to put a button into the game and catch the click on it. In Godot is insanely easy to add a button and then remove it. So maybe this is the way to go.