I don't know the cost of putting in a Main Deck Cargo Door today, but back in the late '90s the going rate for an A300 (same fulelage), was around $6 million so I would think around double that today.
I wonder how the sums add up given that the A340 only carries around 3/4 the payload of a B777 freighter and burns more fuel.