Tony Barber at the Financial Times has a very interesting article on a possible NATO policy of buying all of Afghanistan's opium crop and using it for medicinal purposes. The idea is that this will reduce the drug trade and reduce the funding of organised crime and terrorist organisations through the drug trade.
However, I think a major weakness of such a policy would be that it (by itself) does nothing to encourage Afghan farmers to grow traditional crops; indeed switching to traditional crops while Western governments are buying your produce would be a risky move, as any farmer attempting this would be leaving a secure market to try one which might have a learning curve for the farmer (would many farmers be experienced with traditional crops? Do they grow a small amount themselves to feed their families?), and require building up new buyer-seller relationships in a market they are unfamiliar with.
Perhaps what Afghanistan needs is... some version of the EU's Common Agricultural Policy?
That probably sounds like a strange idea, but it would be a good way of creating a more attractive, more secure market for farmers to grow (return to growing?) traditional crops. It would be hard to place a similar burden in terms of prices on the Afghan people as Europeans are under, but a system of subsidy and (perhaps more controversial, especially for the EU) more secure market access for Afghan farmers to western economies could help create a solid agricultural base in Afghanistan. With population growth and global warming, there should be a good market for Afghan food which will help an emerging agriculture sector to survive in the market when the West reduces and then ends protection of Afghan farmers.
This could also encourage more Afghans to "buy into" the system, and be a way of reducing the influence and support for terrorist groups.
That said, I'm not an economist and I claim very little economic knowledge; this is just an idea.