One thing that I always do when "noodling out a melody" is play to the Metronome. I think that it makes a difference when improvising to try to align your musical ideas to some kind of "beat," because this affords rhythmic possibilities as well as melodic ones.
In the Apple Loops library, I use 70s Ballad Drums 01
as my metronome. It's got a nice slow beat but not overwhelming.
Another thing that I routinely do is to edit my "original noodling" track – which is then forever muted – in an attempt to arrange the "noodles" into some kind of sensible progression. (I might do this several times, taking care to preserve each and every one of these "experimental" tracks. I never worry about running out of disk space anymore, and every one of these "attempts" might be "just what the doctor ordered" someday.
Hate when you do something and then forgot how you did it. That's why I use Capture Recording