If you don't find it too much trouble, you could just delete the button if you aren't going to use the legend: /c game.player.gui.top.EMC_legend_Main.destroy()
It shouldn't return until you load your save again or start a new map...
I would like to have it only show up when the map is opened, but I've been unable to get custom events working. perhaps I can add a config file till then.