If Advanced Factories become indestructable or can be rebuilt after destruction, the Neinzul Enclave IVs will need to be looked at. Currently, a Neinzul Enclave IV requires about five planets of knowledge to unlock, without considering the cost of getting the Mark II and Mark III versions. With those, it costs six planets of knowledge. I can currently justify this in a game with exo-waves since I wouldn't necessarily be able to effectively defend the Advanced Factory, and I might be able to justify this in a non-exo game if the two Advanced Factories spawn in very bad locations, but I don't think I could if I were able to rebuild the Advanced Factory several times over before I approach the AIP cost of getting Enclave IVs. (Note that I'm not saying that I always get Enclave IVs in games with exo-waves, nor am I saying I always consider getting them in games with exo-waves; rather, I'm saying that in games with at least one exo-wave source, I'll consider getting Enclave IVs rather than trying to hold an Advanced Factory if I want to make use of Mark IV fleet ships).
As for the use of temporarily increased AI attacks against a rebuilt (or rebuilding) Advanced Factory, wouldn't this either need to be a CPA/exo-wave style event or cause the planet to lose the main benefit of a Warp Jammer command station, to avoid sidestepping the penalty by using a Warp Jammer command station?
With regards to the "take planet, build fabricator or Mark IV fleet ship caps, decide to hoard or use caps after loss of fabricator/factory" stuff, I think this is essentially the same as using the ships out of a Zenith Reserve. It's a trade-off between the potential use of the ships now against their potential use in the future. If my replaceable fleet is doing well enough, I'll hoard the ships that I can no longer replace so as to have them for a later stage of the game, otherwise I'll make use of them as I see fit. As a side note on the general usefulness of fabricators, I don't usually go out of my way to take fabricators, but if there is one which is easily defended, or only accessible through a world I want to take, I might make use of it as a fortress world that gets its own dedicated cap of some ship type, or to provide a fortress world with a dedicated defensive group. If there are active exo-waves in the game, though, fabricators and advanced factories tend to become a lot less valuable to me, both because they tend to get destroyed (either as the objective of an exo-wave, or incidentally as the exo-wave goes through) and because whatever exo-source I turned on is usually at least useful enough to make up for the lost potential of mark IV fleet ships or whatever comes out of any fabricators I might otherwise have taken.
As for potential AIP penalties for rebuilding an Advanced Factory, this depends to some extent on what gets done with Neinzul Enclave IVs, and also whether or not you want to encourage taking the other Advanced Factory instead of the one we already took if we lose it. Current Enclave IV knowledge costs suggests that the value of a relocatable and infinitely rebuildable Advanced Factory is about 100-120 AIP, while a one-time replacement is worth about 20 AIP. So if you want to encourage the player to take the other Advanced Factory instead of rebuilding the one that was already taken, the AIP cost for reconstruction needs to be at least similar to the AIP cost of taking a planet, while not being so high that the Enclave IV becomes clearly superior in any situation. On the other hand, the AIP cost also can't be so low that it is never worth unlocking Enclave IVs or taking the other Advanced Factory. This would suggest to me that the AIP penalty for reconstruction should be between 10 and 40 AIP (and if you want me to consider taking the other Advanced Factory rather than rebuilding the one I already took, the reconstruction cost probably needs to be at least equal to 20, since I probably took the Advanced Factory on the world I considered more defensible or which was in a more strategically useful location).
I see several ways that this could be handled:
1. The AIP cost of rebuilding an Advanced Factory could be approximately equal to the cost of unlocking Enclave IVs (say, 60-100 AIP, to account for the 20 from taking the planet and the benefits that an Enclave IV has which the Advanced Factory doesn't provide, assuming that Enclave IVs remain the same as they are at present), at which point it becomes a Human Advanced Factory, whose remains cost no additional AIP to rebuild.
2. The AIP cost of rebuilding an Advanced Factory could be set so that in a game where you end up needing to rebuild the Advanced Factory, you likely end up paying only a little less AIP than you would have if you had unlocked Enclave IVs instead of taking the Advanced Factory.
3. Enclave IV knowledge costs could be adjusted so that the AIP cost of the knowledge for Enclave IVs is similar to the AIP cost of a 'reasonable' number of reconstructions of the Advanced Factory, which begs the question of how many times is a reasonable number of times to reconstruct the Advanced Factory.