The recurring theme (with the Boléro-esque beat) was started off as a jam session by Brian May, Roger Taylor and John Deacon jamming in the studio in Montreux. From then on Freddie Mercury composed the song and added the long interlude. The melody is Mercury's as well. Lyrics were started off by Mercury but completed by drummer Roger Taylor.
Yes guitarist Steve Howe played the Spanish guitar solo in the middle because, admittedly, Brian May couldn't do it. Steve dropped by in the studio to say hi to producer David Richards, then Freddie invited him to join them on the track.
The middle section was primarily Mercury's work. It features a flamenco guitar solo, followed by a classically influenced bridge, and then the solo again but performed with electric guitars. This section is especially complex, featuring a pattern of three bars in 5/4 time (reasonably uncommon in popular music) followed by four bars in the more often used 3/4 time. Plus the end of the flamenco-guitar style is based on the 5/4 bar, but is in 6/4 time.
An innuendo is an indirect or subtle reference, especially one made maliciously or indicating criticism or disapproval.