Disable trading except when a certain AI package is enabled. So for example along with his normal routine, have like:
TravelPackage01
TravelPackage02
Or whatever. They will both be identical, expect one will allow trading and the other won't. Have a condition on the first that makes it so it only runs if the quest is not completed, and the other so it only runs when the quest is completed.