Continuing the discussion on re-purposing the magic research rules for other things: the way holy shrines work is itself a re-purposing of some ideas I have about arcane libraries. Some variations of magic research allow reduced research costs if the magic-user has a library available. I thought about including the cost of the library as part of the cost of research, but that makes it easy to build up a library that guarantees success when researching 1st level spells.
I decided instead that it's easier to assign levels to arcane libraries. A 1st level library lets you research 1st level spells, but not spells of 2nd or higher levels. A 5th level library lets you research spells of up to 5th level, but not those of level 6+. The library's level acts just like a shrine's level: it doesn't add to the chance of successful spell research, it just sets a minimum target number. As long as you spend the minimum required on spell research, a 5th level library gives a 25% chance of success.
A hypothetical arcane library that would grant automatic success to spell research would be 20th level and would cost a minimum of 262,144,000 gp ... and you have only a 1 in 20 chance of successfully creating the library, at that cost. Spending 5,242,880,000 gp would guarantee that you'd get a 20th level library, assuming that's even possible. Perhaps max library level would be max spell level? Even if it isn't, 260 million plus in gold pieces seems like an unreachable amount, even in most Monty Haul campaigns.
If someone steals a wizard's magical tomes or sets fire to the library, the value of the lost materials lowers the library's level. How you handle this wouldn't be set in stone, but for example you might rule that a thief could grab 1d20 x 1,000 gp worth of tomes at a time, or an out of control fire would lower the value of a library by 1 level every 2d6 turns. It all depends on what seems right for the given situation.