I was just dealing with this issue, and I'm positive there's a better way of doing it, but this is what I did.
In your EditorPlugin class
var nodes = get_editor_interface().get_selection().get_selected_nodes()
if nodes.size() == 1:
node = nodes
if node.get_class() == "custom_node":
# now we know the editor is selecting your custom node, hide() or show() your button or dialogue
And then in your custom_node class
func get_class(): return "custom_node"
I'd also like someone else's input, because this method doesn't seem like the best way of doing it.