Hello,
It is possible it is attention behavior........but I am concerned since there was a original injury and the fact that she does do it sometimes when there is no attention situation. I would strongly recommend that you set up a appointment with your vet. Since she is young there is the chance that she has some hip issues or even a old injury that did not heal well.
Sometimes stress or excitement can cause a dog to display discomfort from old injury's as well. So it is possible that there is a issue that needs to be corrected.
Walter
Breeder
Breeder and pet health consultant. Have spent a number of years with dog rescue, training and health