Okay, the obvious trap set would be Explosive Runes, meant to be detected and dealt with. Inside is a Symbol of Chaos, permanent, which will affect all around. (i.e. the party).
And of course, the final chamber itself is not unique. There are five chambers with five books. Finding the right one is fun. And if the trap is set off, the books shuffle so they need to start their search all over. Prepare five different clues, and have the clue change when the rooms do.
One simple way to know if the Heir is the one present: They would know to come alone. Pick a detection spell and use that as a way for the trap to know if anyone else is present.
A fun variation would be pressure plates in the floor. The Rogue can spot them, if he/she looks, but they don't seem to do anything, as if the trap had been triggered long ago and was no longer functioning. In fact, they prime the trap if more than one is depressed. Or if none are, in case somebody decides to get cute with Fly or Levitate.
So the party has to do the hardest thing in the world for PCS: Stand outside where they can't see the action, and wait while one (and only one) member has all the fun.
Alternately, consider a teamwork challenge: The pedestal with the book on it is slightly out of phase, and appears to shimmer with many colors. As a person approaches, it drifts away, somewhat like a rainbow does when you walk towards the end. Spells like Dimensional Lock might secure it in place, but also have a chance of locking it out of this dimension for the duration.
To reach it you need a partner, or you need to know the way to it so well you can walk it with your eyes closed. The partner method involves one person standing in the doorway, watching the book from a fixed point. The other person walks, either blindfolded or backwards, guided by the spotter's advice. Until the seeker actually lays hands on the book, it will retreat whenever the see it close up.