Again Glenn, these are admirable questions and really useful! For starters, when I "write" a melody I almost always will start by improvising singing over the track and will record the improvisation so as not to miss anything. I will sing words that come into my head or sing syllables...not words. ... To get the point across. After looping the section I am writing over, I will listen back and then refine from there. Composing in real time in a sense... Sometimes the melody is intuitively in my heart (head) or gut at the moment of creating the composition as well, in which case I would be playing and singing together to record the creation. Difference between a guitar solo and melody is that 1) the guitar solo sometimes contains intervals (two notes at once) or even triads (3 notes as u know), or double stops... Open strings etc .. The guitar solo can be a melody for sure. Example being the guitar melody at the end of the Purple Rain solo. Do, ti, do, ti, do, ti, re, la, ti... Etc. Will answer the rest of the questions later. Going to a job interview at the moment 😅