Watch the Hippity Hop online guitar lesson by Jon Finn from 30 Melodic Modal Rock Licks You MUST Know
When I first came up with this lick, I based it on a "free association" thing I do sometimes. Sometimes when improvising, I like to slide around the neck to find cool notes, but also skip to non-adjacent strings to play a few notes, simply to make things a little less predictable.
For this lick, I played the idea over and over until finally I was able to repeat it several times playing it exactly the same way (typically, I would explore the idea when improvising and let it be different every time). Finally, I wrote it down on paper. There are several places where you skip strings to get cool, but unexpected notes. Check the notation and tablature to get the finer details. Practice with the backing track or metronome, then invent your own version of this lick!