Instant confirmations with pre-published, locked, transactions (Clarification: This is not an attempt to solve the problem of a vendor taking the money and running without handing over the merchandise.  Problems like that can't be solved without some third party.  The purpose here is for A to give bitcoin to B, where B can be instantly certain that he has access to the bitcoin.)

I have an idea that depends on the Script system in Bitcoin, but maybe I'm asking too much.  It would allow for instant confirmations between parties who arrange a negotiation a few hours in advance.  I don't know very much about Script though.  Is the following scheme possible?  Would extensions to the Script be required?

Person A and Person B are going to meet in a few hours for a business deal.  If all goes well, they hope to shake hands and A will want to instantly send some BTC to B.

In advance, A publishes a transaction that sends the money to B.  By the time the meeting occurs it will have received enough confirmations.  But this won't be a normal transaction.  It should include some further conditions:

First, the transaction should include a hash, such that the transaction won't complete unless a document is produced which has that hash.

When they shake hands, A can instantly show that document to B and B can verify that the document produces the correct hash.  B can then be confident that the transaction will be processed fully later when he produces the document.

There is no double-spending problem here.  The output of the special transaction has already been locked to send to B, it cannot be sent anywhere else.

We need a way to rollback this if A and B do not reach agreement.  Can Script allow a transaction to be cancelled if its outputs are not used a specified timeframe?  I guess not.  (Partially cancelled, the transaction fee should remain valid.)

Another approach to this rollback is for the special transaction to also include a special output which sends all the money back to another of A's address.  But this should have some sort of time lock on it, such that it isn't allowed to happen until a suitable delay, 24 hours, has occured.  Is it possible for the outputs to be double the total inputs in a case like this, where maybe we can prove that only one output can be claimed?  (I envisage having non-overlapping timelocks on both transactions in order.)
This is a solved problem, see https://bitcointalk.org/index.php?topic=25786.0 and this.

It has also been recently implemented in BitcoinJ, and called "Micropayment channels".