I don't know of any scripts that would do this. There could be, but not that I'm aware of.
I'd bet this was done by hand. The artist had a structure, in this case an illustration of a brain. Then off to the side, they created a type object or expanded type of each letter, then copy/dragged each letter into place.
I'd estimate this would take 2-3 hours, but potentially as little as an hour.
If this request came across my desk I'd do it by hand.
I'm not sure how a script might achieve this. I'm sure it could. Maybe each letter is a symbol, and you make a script that somehow fills an object with random letters, set to random rotation and random size within a defined range, with no overlapping.
Or maybe populate the letters based on a greyscale raster.. Not sure if that's even possible.
That leads to why I think this was done by hand - the letters around the edges are flush with the edge.
Regarding the color, that can just be a single gradient applied to the art, after the structure is finished and you make everything a single compound path.
Maybe someone else will chime in with another idea.
*Please remember to Rate our replies or check Solution if solved. If you get a good idea from the post, consider clicking the Kudos option.