I am delighted to hear that you enjoyed the Mendelssohn Octet! It is one of my favorite pieces of chamber music for the very reason that you mentioned – it is happy.
First, let me discuss some of the distinct things which you mentioned hearing before I share my take on sprites, forests, and the nature of human joy. The clearest of these has to do with form. You mentioned hearing the piece “ending” twice before the final cadence, and you are right, in a sense: you are hearing the natural harmonic and structural cadences that are an integral part of classical form. In this instance, the first movement of the Octet is in sonata form; you hear first the conclusion of the exposition and then, two-thirds of the way through the piece, the “end” of the development section as it begins the re-transition into the recapitulation.
Sonata form is a basic staple of classical music (the latter being broadly defined). It consists, most simply, of three parts: Exposition, Development, and Recapitulation. In other words, initial themes are presented in the exposition; they are broken apart, tried, and manipulated in the development; then they return afresh in the recapitulation. Traditionally the development section in sonata form is a period of apparent confusion, distress, and tribulation. When the primary themes return in the recapitulation, there is relief, harmonic return to the original key, and a feeling that the trials have been successfully endured. Yet, the recapitulation is never simply a relapse to the exact material of the exposition – the original themes are informed by their trials, perhaps infused with a greater sense of pathos or triumph.
Now, on to the sprightliness of the piece. This is an understandable hearing of the Octet; Mendelssohn composed his famous incidental music to A Midsummer Night’s Dream less than a year after composing the Octet. Since he is not averse to citing from his own works (his Violin Concerto in E minor, Op. 64, for example, expounds on a direct quote from the Octet) it is not unlikely that there should be some overlap between the two pieces. The Scherzo movement in particular, as you mentioned, is particularly evocative of the spritely nature of A Midsummer Night’s Dream.
From a musical perspective, I assume that many of the sprites that you are referring to are depicted through this 16th note motive:
These passages make use of a bowing technique called spiccato which causes the music to sound light and bouncy. Parts of the piece are also underscored by pizzicato passages in the lower strings; this adds to the lightweight nature of certain passages. This sixteenth note motive is passed around among the different parts; this may contribute to the feeling of sprightliness as well.
But, finally, I have to address the main thrust of your response to the Octet: that the piece expresses a joy that is not human. There is a time and a place for explicitly programmatic music; the sprites and the fairies dwell comfortably in Mendelssohn's A Midsummer Night's Dream and even in the Scherzo of his Octet. But here, in the first movement of this magnificent piece for eight string instruments, sonata form does not relinquish its power for truly human expression. Rather, it wields this power to remind us of these images but more importantly, to transcend them. The Octet is not naive to the full scope of the human experience.
Through sonata form the first movement acknowledges trials, in its development especially, and the conclusion of the movement expresses real triumph and victory over them. To me, if the Octet says anything it says this: that joy is not only possible, but that it is real. The Octet, I assert, is great not because it is naïve to human suffering but because it teaches us to look beyond it. The triumph expressed in Op. 20 -- to me at least -- is not born of fairy tales; it is instead a truly human proclamation of hope and joy.