The more I think about this the more plausible it becomes.
Obviously you couldn't just do it like the old BASIC programs that would spew out endless nonsense along the lines of "The big strong man greased the fantastic donkey while a small dog sniffed a dangerously cool sky" and "the gorgeous tall woman mislaid the dirty cocaine because a heavy elephant guarded a furiously normal cat". I know those sentences read like I've copied them out of a Jackie Collins novel but I can assure you I haven't.
But that was when I was pissing about on VIC-20s and Spectrums. With today's computing power, getting a computer to write a "story" of some kind would surely be a lot more doable?
The principle would be the same - just a bunch of randomly-generated permutations - but you could make it a lot more complex. You couldn't just substitute words, it would have to be substitution of phrases (or even passages?) and would need a load of outlines or scenarios to begin with...yes, this could definitely be done. It would be pretty unlikely ever to produce anything worth reading but I think something could be knocked up.
I suppose the best you could hope for would be a machine for writing to a formula (this is how Barbara Cartland did it apparently, she wasn't even alive for the last twenty years. It's amazing nobody noticed, given how clownishly bizarre the animatronic figure looked whenever it was activated for public appearances, but hey, sometimes you can't see the wood for the trees).
More thought needed...