I use an old hacked up perl version that predates the ability to edit config files from admin. But I've seen how it's being done on some other updated threads boards, and noticed some shortcomings.
The code I've seen has a hardcoded config file in the script used to edit config files, meaning any changes you make to the actual config file, such as added variables, are lost when you edit it with the tool!
So rather than have an individual script for each config file I wrote a single script that serves as a simple file editor. This way any file can be opened, edited and saved without fear of data loss, and allows adding config variables at will.