I dunno if this can possibly help you, but I too have to have to perfectly complete my routine, but what I do when I mess up, is I do everything backwards—literally—until I'm back at a state where I know everything before it was in order. For example, If I put toothpaste on my toothbrush before rinsing it, I suck the toothpaste back into the tube and then rinse the toothbrush, then put the toothpaste back on the toothbrush. It's really gross, but over all it's better than doing the whole routine over. I've also made that specific mistake only extremely rarely after I started using the backtracking trick. It's like a personal `undo.'
Another thing is I modularized my routine into self-contained subroutines, so that if I mess up, and I need to start over, I can start over at the start of the subroutine that I messed up.