I've implemented cancellable progress bar support in cdebconf (0.95, not
uploaded yet). For now, it only works in the newt frontend; I looked at
implementing it in the gtk frontend too, but the way that the gtk
frontend sets all its widgets up in advance meant I had to think a bit
too much about it and gave up for now. I may do that later if nobody
beats me to it.
For obvious compatibility reasons, this isn't enabled by default; you
need to say 'db_capb progresscancel' or equivalent before starting up
the progress bar if you want to get the cancel button. Once you've done
that, the PROGRESS SET, PROGRESS STEP, and PROGRESS INFO commands may
all return 30 to indicate that the user cancelled the progress bar; you
may then do whatever's convenient in your UI, which will usually involve
either going back to the previous screen or perhaps skipping the step if
it's optional.