So it destroys the Dance buildings and a number of other buildings. All buildings that need these as OR buildings now need to have those requirements removed.

. That is Storage Pit, Barter Post and Trading Post must not be requirements for other buildings.
Why would you need a building prerequisite to be only an autobuilt building? Are you suggesting people just don't build buildings they have available so we have to enforce that the buildings get constructed? I'm not understanding what you're saying is broken here.
I was half way through building the Dance Hut when the Storage Pit became obsolete!
By what was the storage pit obsoleted? Maybe that's coming too soon? Usually we don't obsolete buildings before we can replace them and I thought the granary was the replacement for the storage pit and that technically the storage pit either didn't obsolete or was obsoleted some signficant amount of time after Granaries replaced them. Are you suggesting that whatever it should've been replaced by, such as the Granary if I'm correct, should be an OR prereq for the Dance Hut then?
A little AI issue. Now, sell a building look like a feature, and AI never use it to sell Crime/Rev building (like Druglord's Mansion) when they have Crime/Rev issue...These building are often the #1 source of these problem and they don't really worth having a high crime or a revo.
1)It would be a very time consuming evaluation to setup a system that looks for things that should be sold off by the AI.
2)The AI should not be in the business of wasting production time previously invested into useful buildings
3)There is no amount of crime buildings that cannot be countered by proper LE unit use to counter it, and it is less expensive to counter the crime generated by one of these buildings than it is to maintain the LE unit(s) needed to counter it.
For these reasons, no, the AI does not sell off any buildings ever and it is not a plan to get them to consider it because most players feel the turn times are more important than a more advance AI, particularly when such an advancement could end up being more of a problem for the AI than a benefit.
Therefore, the problem you are pointing to is more interpreted as a code problem with proper unit use - and there's a few known issues there, such as not being able to transport property control units yet, for example.
I have Barter but the value of the Barter Post next to all the other buildings is negligible. 1

is much better return than any amount of money at this point in the game. Most of the commerce buildings are like that. My Demand Mod tried to make them worthwhile but the "actual" values didn't work properly.
Given what the barter post unlocks by being a prerequisite, it's value is still strong enough for a developed player or an AI to recognize and build, even if it's not a needed immediate gain. I thought gold challenges were a little stronger at that stage now? Still not enough in the late prehistoric perhaps?
The Storage Pit should be replaced by the Granary not obsoleted by Pottery, imo.
I'm surprised it isn't already. One of the tricks we might have forgotten here is that you shouldn't obsolete something as soon as its replacement is made available - the obsoletion tech needs to be significantly after that point. Maybe that's the issue?
Also many buildings that are currently requiring the Barter/Trade Posts should be requiring the Granary instead as their OR buildings because it is about feeding these artists not paying them. You can't eat money
OK. Identify what those are and it can be adjusted.