Are you familiar with tablature? It shows the fingerings on the frets, so you need to know the rythm going into it. Scales are also represented in tab, sometimes called scale 'boxes'.
If you're picking out melodies in the chord positions, the same shapes or patterns will tend to apply up the neck, only you have to finger what would be the open strings. So, for example, if you're in G, you figure on the third fret it's like you're in E, on the fifth like you're in d, using an imaginary capo.
What you're working on might be tricky to do--a guitar player I know who doesn't use capos is often amazed by what some player does in what he imagines is the position, not realizing its capoed. It might be a different tuning, or sometimes people use an odd combination of high fingerings with open strings to make a line with a harp-like sound. If you don't know that they're doing that, trying to figure it out can drive you insane. So you might be missing an ingredient in trying to pin it down. I've even been tricked by two guitars into making up my own approximation of what they were doing.
Don't get too frustrated, noodling around is it's own kind of fun, and builds your ideas for things to do when you want to change a part, or craft your own solos. Oh oh, sick boy home from school, gotta go yall.