It occurs to me that midrash is a way of playing with the Torah to address a kind of attachment disturbance between the Jewish people and God, between me personally and God. Two things got me thinking about midrash and Torah this way. First was Avivah Zornberg's suggestion in her commentary on the book of Exodus that the Torah is both a transitional object and a transformational object. Infants and children carry, embrace, and fondle something that is a kind of "piece" of their mother whose feel, smell, or sight of reminds them of their mother when she is away. By holding and playing with this transitional object, they can hold it together when they are separated from their significant other. Like Linus' blanket in Peanuts. But also like Linus, when he plays with his blanket, he can transform it, in the process be himself transformed as his play gives him space to grow and develop his independence, even play at being a kind of grown-up himself.

With a transitional object, we maintain the attachment of love, affection, being cared for that we need to thrive and grow, but also the separation from our significant care-giving other that we also need to thrive and grow into our own. The creative pre-occupation involve in playing with with our transitional/transformational object makes us both remember and forget the trauma of separation we feel.
Second was the parable of the ketubbah we studied. It also makes this point about the importance of playing with a transitional object, and specifically applies it to scripture as being the object that makes the very painful separation of God from the people of Israel bearable, just as holding, fondling, reading the ketubbah and the promises of everlasting love and devotion enable the wife to bear her separation from her beloved husband. By playing with it, engaging in it, we can evoke the feelings of being with our parent or lover as if he were still there, even though we know very well he is not. As our spiteful neighbors remind us. And interestingly enough, both Zornberg's commentary on the Exodus passages, and the parable of the ketubbah in Lamentations Rabbah punctuate their interpretations with the same verse from Psalms: "If your Torah had not been my delight (or "plaything"), I would have perished my affliction." (119:92). Midrash turns Torah into something we can, we must play with to keep alive our affection for its source, but also to grow and adapt with our "plaything" to new situations without being suffocated by the love of our significant, formative parental Other. We need space to play and grow, but we need also to feel loved and cared for as we carve out that space for ourselves, or when life's circumstances inevitably separate us from those who love us and vice versa. We still can connect. So yes, "If your Torah had not been my delight (or "plaything"), I would have perished my affliction."
And "THIS I call to mind and therefore I have hope." (Lam 3:20)
