Hey there! Most DnD Dungeon Master books is a good place to start for building good dungeons. It’s pretty easy to adapt them into a CYOA story format.
I think the biggest problem with starting a CYOA story is dealing with the different choices. I don’t have any books, but this site and this example tree helped a ton when I first started turning Monarch of Witches from a linear story into a non-linear one:
I highly recommend starting by planning out what endings you want to make possible for your players. Then, later on you can expand on everything in between the start and those ends. It helps keeping your story organized and keep you from writing off into endless tangents. Hope this helps!
I think the best game-design advice I ever got was from the AD&D 2nd edition Campaign Sourcebook and Catacomb Guide. It’s geared toward writing good D&D adventures but pretty applicable to writing games too. I’m sure this kind of thing exists for 5e, too, but I haven’t really felt the need to seek it out lately.
For actual writing advice and exercises, consider Ursula K. LeGuin’s Steering the Craft.
Steve Jackson and Ian Livingstone actually released a couple of FF books that could help you out. They might be worth a look. Otherwise, this forum is full of helpful people who can give advice and feedback!
Old books. I forget the names off the top of my head but there were 2 or 3 books… I think one was called Dungeoneer. I’m sure searching google can help.
Specially in relation to dungeon building, there are some PC games that allow players to create their own playable modules. The only one I’ve ever gotten into that is like this is Neverwinter Nights, but there are others that are much more recent. This is another way to get into dungeon building as besides being able to create a dungeon in a visual setting that you can play through yourself to test it out, you can check out what other people have created to see what you do and do not like in terms of dungeons. Naturally not everything in a video game dungeon is going to translate well into a COG dungeon, but it is another way to approach dungeon building.
For myself - I like dungeons with a fair amount of traps and secret doors.
Modding itself is an introduction to game design and world building.
A lot of people here are involved with the various Paradox games (Crusader Kings, Europa Universalis, etc) and a scripting language for such engines is like the CS scripting language.
Building a successful mod will help a person understand some basics without needing to build the entirety in the first place.
I love EmShort and second her blog as a great resource for learning more about IF theory. And more specifically if you haven’t seen it yet, OP, she does has a page listing a bunch of reading recommendations for IF design and theory.