This article describes how to add web.config settings automatically to your new web applications under WSS V3 and SharePoint 2007.
You need to create a file in the format of webconfig.[name].xml, copy the file to C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG folder and the settings in the file will be merged with the web.config file on any new web application.
Read the complete post at http://dhunter-thinkingoutaloud.blogspot.com/2007/07/adding-webconfig-settings-to-you-wss-or.html