I think you might have an XY problem. I'm pretty sure that there's a better way to do what you're trying to do, but I'd need to have some more context in order to point you in the right direction.
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?