Firstly, you have to send the ship they tell you, not a different one; it has to be in the harbor before the assigned day. Just leave it there. It will automatically begin the guarding of the harbor. When the boycott is over, goods will be very cheap that the town produces, and very high prices for the goods they demand. Load your ship with those goods, it will be first on the scene.