It was practically unavoidable because transaction had more than 6 confirms in the +0.8 blockchain, which was later dumped by the miners.
But this
would have avoided it. It would have detected the existence of a double spend seen on the network and locked the transaction for several days, like 500 blocks.
Once you know a double spend exists of your payment, it is a dangerous payment and should be held for a long time before accepting it.
I don't think you really understand the issue here. This wasn't a normal double-spend that you can avoid like you say, the situation here is more like when someone sends bitcoins, waits for the 6 confirms then withdraws cash from the online wallet or exchange with the purpose of double spending them in a different blockchain fork. He just have wait for the network to reorganize the blockchain, based on consensus, and then he will be able to use the same coins with other wallets or services, because the original spend was confirmed only in the 30-40 blockchain fork that was left behind, hence no spending occurred and the wallet service is left holding the bag.