It's actually pretty amazing how "good" eliza was at having conversations, not using anything like contemporary machine learning technology at all. That first conversation snippet in OP that OP says is "kind of scary" is totally one Eliza (or similar chatbots) could have. Weird to remember that some of what we're impressed by is actually old tech -- or how easy it is to impress us with simulated conversation that's really pretty simple? (Circa 1992 I had an hour-long conversation with a chatbot on dialup BBS thinking it was the human sysop who was maybe high and playing with words)
But I doubt you could have used eliza technology to do code completion like copilot... probably?
It is predicting how a piece of text is likely to continue, and it probably had examples of the original ELIZA conversations, and other similar documents, in its training data.
If the user took charge of writing the ELIZA responses, then it would likely do just as well at predicting the next question of the "human" side of the conversation.