As boring, unpleasant and uncool as many aspiring musical gods seem to think it is (including a young Beepwad) that type of hearing and mimicing is one of the many benefits of practicing scales and chords in the context of a key. You only have twelve notes to work with (in western theory) and once you have pounded all the common variations of those buggers into your noodle (diatonic, pentatonic, blues/C&W/R&B variations, etc) through constant repetition it becomes soooooo much easier to latch on to melodies and chord progressions.
I used to think I was doing myself a favor by avoiding all theory so I could be as "original" as possible... and in certain ways it did help me develop a bit of a unique style but once I learned how it all worked I realized all that "original" crap I was doing fell smack dab in the middle of what I had thought I was rejecting.
In the end I can't say whether my little experiment failed or succeeded (I may have developed the same style anyway if I had learned theory earlier on) but now I know that I can write in my own style a lot better and easier and, of course, everything else is a lot clearer and easier to figure out now.
Thing is though I still generally don't write using theory. I use my old methods which is essentially just spazz out until something sounds good and then string together a bunch of things that sound good together. The difference is now I can really texture it all better by identifying the modes and chords my little spazz out is using and depending on what is being played I can yank out multiple licks and runs of varying qualities to lay over top if it switching and swapping them to change the flavor. Some progressions are locked into one specific mode or set of notes while others allow for many different things to be played. Without KNOWING what's what I would be stuck grunting things out through trial and error (and a lot of it still does come down to that). It's really a massive time saver and I still get to be an ultra spazz when I want to be (which is like pretty much all the time... lol).