I can write decent original guitar / keys melodies in my own time. But when I'm with other musicians I'm lost in a jam session (unrehearsed).

I have a handful of times been lucky enough to produce some brief amazing moments in a jam session on guitar but the rest are just a mess or boring. 

I can improvise melodies vocally on the fly quite easily. Does this mean I'm a singer at heart, is this just lack of technique and theory or is this the reason why it can take years for a band to write an album.

I like to hear the music and then in my own time explore the guitar for the right sound to fit it well. But with naivety comes quite original content, I'm concerned that learning scales like the back of my hand may be detrimental to originality. A few of my friends know theory backwards and can play for 30 minutes sold and sound decent (which I would like to be able to do) but they rarely play any melodies that tickle my musical lemming.

I often play songs to friends with a good theory and they are always breaking down my chords and analysing them, to understand why what I do works well.