Jelly, 88 6 bytes
s2EÐḟṪṪoEÐḟṪṪo
-2 bytes thanks to Nick Kennedy informing me of a rules change. (His proposed golf, EÐḟFȯṪ
, seems somewhat more clever but has the same length as my previous solution minus s2
.) The input format now takes the commands as a list of two-character strings, but the testing footer translates from the old format for convenience.
Translated from my newer Brachylog solution.
Old version:
Jelly, 13 bytes
ḢẎ⁼⁹a⁸o
s2ç@ƒ
I'm not 100% sure this is correct, but it succeeds on all three test cases. Takes the commands as the left argument and the initial accumulator as the right argument.