What do you meen with "separation of the gui and xecution environment".
oh yes typo execution environment.
Maya operates on the assumption that calculation is separate thing from the thing that the user is doing. Attributes are part of the calculation core whereas the user interface is pretty free to do whatever it pleases. Now if you do this your going to taint up the execution environment by entagning the gui quite roboustly with the execution environment. They are separated for a reason.
By design nodes are supposed to be totally oblivious about how what or who is accessing them. So setting a node to probe the selection list is a slightly questionable act. You will very fast drop into the gray area of maya programming, and it wont trigger.
You can do this with scripjobs, but you will find its NOT exactly productive in terms of versatility. You would put the data up where it belongs in the gui part of the code. However script jobs get tunred off duirng playback, not a issue in this case but its still a aissue that WILL pop up sooner or later unless you KNOW WHAT YOUR DOING.
But then if you know, theres a much more natural way to do this, and that is to implement your ownlocator node and instead of hiding and making extra nodes in the scene you actualaly draw the thing differently when its selected.