Using the Encounter Reactions table on pg 63 of the DMG would certainly be appropriate, although perhaps a bit random on its own. Bonuses for various transgressions would need to be created, possibly on the fly. Another possibility is using the Loyalty and/or Morale checks from the DMG on pages 36-7 and 67 respectively. There are a great number of modifiers for those tables, so it would be easier to eyeball modifiers for the player's behaviour, and the Necklace of Prayer Beads would add a 25% bonus for those checks, in addition to any other bonuses or penalties applied. Alternately, like most other unplanned events, the base chance could just be set at 50% and checked against each spell or against the entire roster of requested spells for that character. Clearly, deities with a Lawful alignment will be less inclined to grant spells randomly, while Chaotic gods may be more so. On the other hand, "the gods work in mysterious ways", and perhaps what appears random to the character is not random at all, from the deity's perspective.
If you turn your attention to the spells listed for Clerics and Druids in the Player's Handbook on pages 40 and 41, you will also notice that the number of spells available at each level is either 10 or 12. In other words, a d10 or a d12 can determine which spells the Cleric or Druid is granted. If the player has not been adhering to the precepts of the religion in question, the DM can easily assign a random slate of spells until the player more closely adheres to the tenets of their chosen faith. Assuming they are granted any spells at all; withholding all spells is certainly an option.
However, as mentioned before, there is no listed base chance. Even going back to the original D&D little brown books yields no details, nor in fact even mentions the possibility of Clerics and Druids not receiving spells they request. Most likely, these odds were something like "tribal knowledge", in that they may not have been universally implemented outside of Uncle Gary's or Uncle Dave's groups. They may not have even been widely known of much outside of Lake Geneva. If your group has not been using such a rule, there is little point to introducing it, and the 25% for the Necklace could be applied to the spells themselves, such as increasing the range by 25% or allowing 25% more hit points to be restored in the case of the various cure spells. Or ignore it altogether, since it doesn't have a very large impact on play.