Currently, maintainer scripts in .deb packages are typically generated by debhelper. Debhelper inserts snippets of shell script to perform specific tasks. If the snippet has a bug, all packages need to be rebuilt.

It strikes me that a more declarative approach might work better:

create-system-user httpd
update-config-file /etc/blipblop.conf

Alternatively, the snippes could just be moved to external tools:

set -e
case "$1" in
purge) dpkg-remove-logfiles --package=blipblop

Edit: Old discussion page.