You're thinking classic game flow programming, which is why you're getting code bloat. Developing the core of a text based game is technically simple and highly maintainable if you architect it properly. It requires you spend time establishing that framework first, before you start writing the game itself. Using object oriented designed code with features like dictionaries (key-value mapping), graph theory, events and delegates (aka signals and slots), databases, finite state machines, and MVC (model-view-controller) patterns, you can write a robust framework that will make building your game and content much easier. I'm not aware of any text based game frameworks that offer anything similar to this, but you may be able to search for MUD (multi-user dungeon) based frameworks. Personally, I think it would be a good exercise for you to try and do this yourself. Unlike a graphical engine, text based engines can be small, simple, and will provide you with some valuable experience when you complete it.