[link to original on tumblr]
---&---
There are two parts to the solo: the first is played by both guitar and mellotron and is one phrase that's then repeated an octave lower (I don't think the mellotron drops an octave though); the second section is more contrapuntal between guitar and mellotron.
The phrase in the first section of the solo starts with an extended (but moderately paced) trill between B and C. In the second section, the guitar phrases start with the same sort of three-note trills that I mentioned earlier: E D E, C B C, C# B C#, F# G F#.
There's an-other extended-but-moderately-paced trill after the solo, during the lines "Until I woke up only finding everything was just a dream" and "That gave me peace and blew my mind / And now I'm hung up on a dream." That's between B and A with a G thrown in at one point. The melody of the lyrics follows it there too.
After I realized that I'd neglected that, I remembered that Rod Argent even talks about the baroque influence on "Beechwood Park" and "Hung up on a Dream" (specifically naming Bach) on the BBC Mastertapes program (at about 13:15).