That is complex way to make something simple: checking if barbarian in the CvCity production!In c2c we gave the barbarians their own trait, and buffed them that way. Giving them huge production bonuses for military and stuff.
EDIT: BTW Sgtslick, do you know how the building cache works ? If i ask an AI to build something, it will change some turns later even if changeProduction is disabled. Is there something that overpass this in C2C which should have been merged in AND ?