I have just started programming these games myself, so I don’t know a WHOLE lot about programming (see my question in the Inform section from last night and laugh…) however I do have a bit of knowledge in computer science with an interest in AI from an armchair perspective, and that is where I will answer the questions about that.
IFs aren’t supposed to exhibit any kind of AI, really. It is a fictive art, not an intelligence science. This is proven by the average size of the story files. There is no way that you are going to program any kind of believable AI with a limit of around 4 MB. Not and have any kind of decent story propelling the game, anyway.
Instead, the creativity of responses within the strictures you set for the outcome of each valid choice the PC can make will present the illusion of AI. That is the art aspect coming into play. That is why a lot of the problems I have seen on the newsgroups (yes, I have lurked long), have less to do with programming and more to do with the same things that plague authors and novelists of all stripes. Plot, character development, and structure are important to maintaining the illusion of a totally imersive world.
That being said, there are some programming tools at our disposal that can help feed that illusion. For instance, creative use of the programming tools to make certain aspects of the dialog random so that subsequent play throughs are somewhat different are possible. For instance, Violet by Jeremy Freese uses such a coding trick. He talked about that a bit in his interview about the game in SPAG recently. (I wish I could find the link, but my work computer blocks that site, sorry).
Anyway, I hope this helped.
P.S. This was supposed to be HERE ([url]https://intfiction.org/t/length-of-if-games/399/1]), but I clicked the wrong button, can someone please correct my mess up?