Hey Vex!
For this technique, you would use invisible actors and tokens. Each bookshelf or stack of books would have an invisible actor saying: “Nothing here.” or something of the like. If you want to go above or beyond, they could have the type of books on the shelf or a funny saying or something. One stack of book or bookshelves will have an invisible actor saying: “I found the key!” Or something of the like, and the hero will receive token “key.” From there, all you have to do is have an NPC blocking the door, or an invisible actor being the door, which is a little more complicated to code, but a bit cooler.
Good luck!