The way that I interpret Yoda's strange behaviours on Dagobah is not that he had lost his sanity, but was bored. Really, really bored. As Grand Master of the Jedi Order, Yoda had spent centuries right in the thick of things. Many of the wisest and most powerful beings in the galaxy came to him for advice.