That’s kinda misguided. Factories are quite different since they are irreplaceable and not available to everyone that can farm livestock.
All you have to do is make pens worse than mills if you use them the same way for passive resource generation, but better if you are investing and actively managing them. If passive trickles have a prohibitively long payback period, and unmanaged villagers are working less efficiently, than at a mill, they won’t just replace mills in all cases.
The trickles should only be for fully fattened livestock tasked at the pen and should be low enough that the payback period is prohibitive. I’d suggest something like a trickle of 0.04 coin/second for sheep and 0.08 food/second for cows. At unupgraded rates that would be a payback period of ~52 minutes for sheep and ~29 minutes for cows (including fattening time and assuming 100 food investment). At that rate of return, you’re better off on mills. But what it would do is make actively managed livestock pens a bit more forgiving since if you didn’t pay close enough attention, the fattened livestock would still be giving a bit of value instead of essentially being idle as they are now. Cards for faster fattening rates and larger trickles could improve these rates.
The other factor would be managing villagers’ idle time. Right now, if there are no fattened livestock, the villager has nothing to do and goes idle. At a minimum, they should have the option to work at the livestock pen to speed up the fattening process. This should be so inefficient that it would be a better use of villager seconds to re-task them to a mill instead. However, it would still be better than them just going idle as they do now.
Overall, the trickles and villagers’ actions should make it so livestock ranching is not so unforgiving with idle time as it is now, but they should be low enough that it isn’t going to be better than mills without active management and investment.
That’s not at all what I’m saying. The toggle would be for if you want to slaughter them or keep them for milk/wool, not for what animal to raise (the type of animal you are raising would determine what the trickle is, not the toggle). You’d only really need that if you could harvest from animals without killing them, and I think a really low trickle rate would be a simpler option anyways.