That's an interesting idea, kind of a way to punish yourself for driving.
I wonder if it would be possible to get a bank to set up a credit card that could do it automagically. They already have the technology to recognize gas purchases, and if they can't get the # of gallons reliably it could just be a percentage. Otherwise the mechanics are similar to that card that automatically "rounds up" and puts the "change" in a savings account.