Uhh definitely don't build factories on small worlds that you plan to use for mining/farming. You lose like 20 turns of potential income for a not-that-large boost to build speed. EDIT: now, if you know you're going to use that factory later to build lots of ships, that's another matter. But that usually only applies to worlds with higher population cap, since small planets are always going to have terrible production.
But yes improving how the AI decides what to build on it's planets does seem like good low-hanging fruit to pick at for improving the AI.