Something like that, but it could be done ahead of time - receive a bitcoin address & redemption code online, send your coins then ~30mins later go to the machine, enter your redemption code and receive your BTC.
Redemption code could also be a QR code. Put it on your phone & hold it up to the machine.
You can instant accept any bitcoin value that is lower to the investment to do the 51% attack or similar.
Example: no one is going to make a 51% attack to steal only 10 bitcoin from a vending machine.
Simply put a limit, or just say to the user that any amount of bitcoin over X will need Y time to get verified.
Anything lower that X amount will be instantly processed.
Redemption code could also be a QR code. Put it on your phone & hold it up to the machine.