If I recall correctly, the AI is supposed to be constructing new buildings with at least 2 tiles inbetween. However, the turtle formation is a size 3 unit (battering ram is size 2, so not sure why it would be getting stuck, unless there happened to be other units in the way), so I can see it getting stuck. Perhaps the minimum distance between buildings should be defined in the faction XML? The other issue I've seen with unit movement is that if the AI wants to move a big unit and a smaller unit is in the way, it doesn't seem to understand it can move the smaller unit.