Okay so granted I have no real clue how the starbound game is designed architecturally, but the AI lag needs to be taken out back and beaten. Maybe you're already doing this, but imo you should spawn a new thread in your update loop and offset the AI work to it. If you are doing that already, perhaps bust it up into more than just one thread. If AI is already on its own dedicated thread, you guys should play around with some sort of proximity based sleep lengths and also bust the work up...
Fix Lag - AI optimization - job pools
Fix Lag - AI optimization - job pools