To my mind this is a case where the traditional-grammar notion of "adjectival" and "adverbial" phrases breaks down.
What you have here is at bottom two clauses describing the same action:
they switch back and forth
[they] alternate their positions
As pyobum very acutely remarks, the second clause
"is almost acting as an appositive [...] restating the action of the main clause rather than adding a separate, simultaneously occurring action."
Note how in quoting pyobum I have combined the original two independent clauses into a single sentence using the same literary device as your example sentence: I cast the finite verb in the second clause ('s restating) as a participle (bare restating) and just tack it on at the end. The non-finite verbform and the fact that the it "borrows" its subject from the head clause marks the second clause as subordinate. But it doesn't "modify" any particular element in the first clause: if it "modifies" anything it modifies the whole first clause.
If you need a name for it here's one I just made up: it's a recapitulatory supplement.