The above code works fine in allowing me to click on the text, but not the pen icon, to change the text there. However it does not save the changes I put here to the units name. Any ideas what I need to do to make this work?
For the pen icon you haven't assigned any actions. Add
onClick { call *node:parent.name@click }
so it will call the
name entry's click event.
About the other issue, hmm yes, You can't do (easily). The hire menu sets a
selectedEmployee variable and renamer uses that. Team selection doesn't set it and it couldn't set it because this code is shared between different game modes (in skirmish there is no selectedEmployee for example).
The solution is to make the renamer function not rely on the selectedEmployee but use for example
UCN instead. (UCN stands unique character number.) For this we should register the selected employee's UCN.... So things are not always easy ...

-geever