The public version of swordfish is a bit over 2500 lines. My private version has multiple RNG's and statistical tools to evaluate their performance. It's over 4000 lines. When I write a very large script it will be a collection of modules and each module will be small enough to understand easily.
swordfish a password generator