Terath Ninir
Yog Sothoth loves you
You've already gotten plenty of advice on how to run with things like this, so I won't belabor that point. I would note, however, that you shouldn't think of the high-level ritual as a reward for the players, be it 10th or 24th level. It's a one-shot item used in the course of the adventure. They can't save it up or use it later -- it's right now, for this scenario, or not at all. Now, if they negotiate with the library for a future favor, where they will use a ritual to help the PCs out on some other matter, that IS a reward, and that is a bigger possible concern. A free use of a ritual at any point in time of the PC's choosing has a much bigger chance of messing up your game than them using it in a specific situation like this, where you already know who the bad guys are and what they're doing.