I raise the irony since the first movement of the Op. 131 (as you may know) is Jewish-themed and Wagner was a professional Jew-hater.
Beethoven moved multiple times in Vienna, from flat to flat; one of his apartments was on the same block as a synagogue, or at least he had to pass it on his walk home. He always had his notebooks with him, and some of the chanting tunes that he heard from the temple he jotted down for later use (this was, of course, while he still had his hearing during the 1790s).
The time gap between notebook and composition is not particularly strange for Beethoven: the theme for the "Ode to Joy" from the Ninth also dates to the 1790s. Both the Ninth Symphony and the Op. 131 were written in the 1820s.
Wagner studied the Opus 131 Quartet all his life, the dance of the whole world itself, as he called it in his 1870 essay. In its seven movements, played without pause, this pathbreaking, mood-shifting and mystical quartet could be seen as offering him a manual on how to organize a long through-composed opera to make it come across as a musical and dramatic entity.