If I were tasked with creating a text-based game, I would work on it in steps:
1) First get the UI all in place, even if it's a simple font, showing a sample text paragraph ("Lorem ipsum dolor sit amet..."), and make sure that I can break text in lines so I can format paragraphs for things like story, decisions etc.
So that concludes the display of text.
2) Work on the system that reads the player input, like reading a number key for the user to indicate what choice they prefer.
So that concludes the player input.
3) Work on the system that reads a
scene file and performs it for the player. From this point on, the engine code would probably stay the same, you would then mostly work on the scene files that define the narrative of your text-based game, including all of the branching (the scenes that fulfill choices like "go left" or "go right" when there's a fork on the road).
Deciding on how you write scenes and what format they're stored in, and how this data is structured internally by the engine, is probably what will take the most time to design.
The most complex of software is still described by a list of instructions or bytecode. Taking inspiration from that, if you use an architecture based on a list of instructions you can definitely describe sophisticated scenes successfully. For instance, among instructions to "show text", "ask question" and such, you would support "jump" instructions to be used when the story needs to branch, so your engine can 'jump' to the (data) point that continues the story based on the decision that the player took, and if a branched route needs to merge back to the main route, then at the end of the branched route you will 'jump' back to the relevant point of the main route.
But to make sure that I can navigate to any point in the story, go back and forth etc to debug and
get a feel for the narrative, I would very likely create a simple narrative editor, something like
the RPGMaker Event Editor, a tool that lets me do all that and in the end export a "narrative file", an asset that the engine would read and perform.