Recommendation: I don't know if it is possible, but regarding the AI's use of Naturalists -
1) before building, check if appropriate site is available in empire. If not, do not build.
2) before building, check if a naturalist has already been built. If so, do not build.