I would try using this function: SetTownBuildingLimitLevel(townName, buildingID, limit);
That is, call it after capturing the town, and the building that was previously impossible to construct will become constructible. Something like that.
------
Or, disable the town using SetObjectEnabled('town name', nil); and then unlock it when attacked.
Auto-translated