This plugin, as well as all plugins, are essentially appended to the main brain when the plugin is selected in the options panel.
The brain has plugin areas which are located at various locations within the main hal brain. These areas are labeled: PLUGINAREA1, PLUGINAREA2, PLUGINAREA3, PLUGINAREA4, PLUGINAREA5, PLUGINAREA6, and PLUGINAREA7. This HapSwap.uhp plugin is loaded in PLUGINAREA6.
It's located in PLUGINAREA6 because of potential conflicts with other Hal brain functions. This has to be considered when writing any plugin.
If you are determined to write this plugin into Hal's brain then I suggest placing it in the PLUGINAREA6 (or in the general vicinity). It might just work like that. Of course, I've never done that before. I don't like to play around with the main script if I don't need to. The plugins allow a person to select or deselect at the users whim. And I think they are easier to modify, distribute, and keep track of than a large and potentially confusing situation in which you could potentially loose track of your brain modifications....
By the way, that was a great idea you had. It made me look into the Hal Commands alittle deeper. Thanks.