Example #2.
In this example I take a different approach, both harmonically and rhythmically. I begin by playing the line close to the original, but then start adding rests, and going into a G min9 arpeggio, broken up into a sequence. After this I go down again, using a E diminished arpeggio, also broken up, and land once more in the comfort of the G min pentatonic scale.
It is of interest to note here that you might want to experiment with your picking approach on this one. Some people might feel more comfortable using a more economy picking approach (popularized by Frank Gambale for example). Me personally, prefer a more alternate picking approach, but not because it’s easier to play it that way.
No, the reason I opt for that picking approach, is because I can more easily accentuate certain notes within an arpeggio this way, whereas the economy picking approach usually lends itself better to a more fluid, less accentuated playing. I personally like to be able to accentuate any tone within any line and really make it pop out among the rest. But try what suits your style the best.
Remember, these examples are not supposed to be viewed as licks that you practice and then repeat. You should always strive to make it your own, and maybe combine it with another idea you have laying around to create brand new lines as you go along. Always practice these things over many different backings in many different styles. Never practice only to a metronome or only one backing. Practicing the same idea over many different keys, tempos and styles, forces you to alter note value, note choice and style of playing them all the time, which is the key to any good improvisation.