I have seen crows and ravens doing similar behaviors, including flying upside down briefly, loop de loops, stallouts with dramatic recoveries, etc. I have always assumed that they are enjoying themselves immensely (which they appear to be), as they are very intelligent birds and part of being intelligent includes an appreciation of play behavior as an adult...