Again, from my experience the way it works is the person at the top has the final say over the general approach (agree with what was said, or detailed rebuttal, or minimal response in order not to get dragged in, or whatever other tack they think best), and the wording.
The relevant staff draft something along the lines of the chosen approach, person in charge accepts in full, makes minor amendments, or rejects it wholesale, or anywhere along that spectrum. The statement gets worked on until the person in charge feels the wording reflects what they wish to say.
So yes, it is shaped by the person in charge, and they are responsible for the statement which goes out in their name.
It doesn't mean that every single word, phrase, sentence has been written by them. That's what Comms staff are for...
So yes, the Queen would have decided (with advice from whoever she chose to consult, staff and/or family) on what overall approach to take. She would have signed off the final wording as being what she wanted to say, and the way she wanted to say it. That, to repeat DOES NOT MEAN SHE SAT DOWN WITH HER BIRO AND WROTE OUT VARIOUS SENTENCES HERSELF.