Another option would be to have the 'default' (or changed trough your CGI) values in some sort of database (could be CSV). Then when you are generating the configuration from the CGI, you could merge both configs and keep the hand edits (by comparing existing tokens) and comments from the configuration file (comments are *somewhat* easier, since they probably have an 'opening token').
yet another option would be to put and 'End of CGI config' tag at the end (or beginning) of the cgi-generated part, and then add some comments instructing the user making the hand edits to put his or her config directives in the proper section...
hope this helps,