+1 for the desired end goal, but I have some implementation concerns:
Why W? W for Walk? Seems kind of arbitrary; "walk" isn't really a word I would associate with this. In any event this seems like the kind of thing that would benefit from being a global shortcut rather than something that only works when the applet is open and has focus.
Why wouldn't you want to be able to do this when there are two sources?
I agree with your judgement on this. I will look into how I can change this.
mpris2Source.sources always has at least one value, that value being "@multiplex". Because of this it will have a length of 3 when there are two audio sources, a length of 4 when there are three, etc. Perhaps I should include a comment to clarify and avoid this confusion.