My first question would be why are you writing a custom action at all? InstallShield's built-in custom actions ( XML File Changes ) already has the ability to remove an element on uninstall. My second observation would be that InstallScript is solid as a language, it's lack of understanding on how to properly design custom actions that tends to cause problems. I'd read:
Installation Phases and In-Script Execution Options for Custom Actions in Windows Installer
Be sure to schedule all custom actions that modify the system as Deferred in System Context between InstallInitialize and InstallFinalize. Also be sure to use the CustomActionData pattern and to have corresponding rollback actions incase the uninstall is cancelled or fails. Otherwise you might get in a situation where your application is installed but the tag is missing.
And of course, never reinvent the wheel where it already exists. (XMLFileChanges) It rarely goes well.