In a nutshell, one rover planner (that's what drivers / arm operators are called) writes the sequence of commands, a second rover planner checks it and then walks through it line-by-line out loud with another ~2 rover planners watching. Then the second rover planner walks through the whole thing again with many other teams listening in and asking questions.
The first rover planner also consults with a surface properties scientist during development of the drive command sequence.
So, if things go wrong it's never really any single person's fault. But still, that first rover planner drafting the initial version of the command sequence bears a fair amount of responsibility.