On a related note, some work on this is already in progress on the dpkg team's proposal page:?Teams/Dpkg/Proposals/ConffileDatabase

One of the stumbling blocks for this proposal is that according to policy, all user interactions have to be mediated via debconf, and that makes for some "interesting" user interaction convolutions. Even if the target application is dpkg, it would not be a bad idea to migrate even dpkg's interactions to debconf, as is the intent of the dpkg team.

Note: This is copied from an unfinished project from last year. Please look at what was done last year.