The short reason of why it sounds so melodic with all 11 notes is that it takes primarily melodic sequences (as well as some augmented I think i heard at one point), and integrates passing tones in carefully. For example, the first notes after the harp like intro, that start the main melody are (with the first note on the high e string):
e: 17 15 14 15
b: 15 15 15 15
g: 15 15 15 15
d: 17 17 17 17
the text box wont let me orient it right, but you can hear the intro by playing each column I have written, left to right. One column at a time, i.e. your basically going through the e,b,g,d in descending order 4 times.
off the bat you can see the foundation of this sequence is the G minor triad, but the note thats changing, and also changing the character of the sequence are in the case, the notes on the high e string. It starts with the 9th of Gm, then down to the G, then to the Major 7th of Gminor, which here is the first "rule broken," and then back to the G. So already,
we've added one of the most dissonant notes that can be added into a minor arpeggio based lick. But it works though, because just popping in to throw you off for a second, before it brings you back to the root.
A good exercise that is somewhat related to why this song works is that, not just notes can be passing notes, but ENTIRE CHORDS. For example, try playing a dominant 7th chord with a 9th added, for example E9 (E, G# D, F#). Then take the whole chord shape and shift it down a half step (or fret), and then do it again. For example, (this is commonly heard), playing E9, D# 9, and D9, with the D9 being held out can sound nice, and weve already used 4 notes that are out of the key of A major (C, D#, F, and G). 11 notes already, and the only one we haven't used is a flat 2nd, or in this case B flat, (A#).
Another exercise directly shown in this song, would be to take a nice sounding chord, such as a minor triad, or maybe 3 stacked perfect fourths, maybe A, D, G, make some sort of repeating pattern or sequence, and pick one note such as the root or maybe add a 7th on top of it, and see how many different "flavors" you can get from altering one note from your chord.