Move Priority

By david stone and darkie.
Priority Moves
+6 Pursuit (on a switch)
+5 Switching
+4 Helping Hand
+3 Magic Coat, Snatch
+2 Detect, Endure, Fake Out, Follow Me, Protect
+1 Bide, ExtremeSpeed, Mach Punch, Quick Attack
0 All moves not listed
-1 Vital Throw
-2 Focus Punch
-3 Revenge
-4 Counter, Mirror Coat
-5 Roar, Whirlwind

A faster Pokemon always goes first within the speed bracket of the move. In every single case, higher priority moves go before lower priority moves.

The 'exceptions' are Assist, Metronome, Mirror Move, and Sleep Talk. These have a priority of 0, and thus if you Sleep Talk Whirlwind, for example, you can go before a slower Pokemon using, say, Tackle.

In Advance, the faster phazer uses Roar / Whirlwind, sending the enemy away, thus giving them no chance to try and Roar / Whirlwind you.

Revenge gets boosted damage from Focus Punch, and does not interrupt it, making it the only attack that cannot interrupt Focus Punch.

Pursuit comes right before a switch if a switch is used. It doubles in power if they switch out. If they use Baton Pass and you are faster, the Pokemon using Baton Pass takes normal damage. If they use Baton Pass and you are slower, the Pokemon they pass to takes normal damage.

Quick Claw gives your Pokemon an 18.75% chance of ignoring Speed and going first within your speed bracket, barring the enemy also activating a Quick Claw, in which case normal Speed rules would apply. Speed and Quick Claw never let a move with a lower priority beat a higher priority (so a Quick Claw activated Deoxys-S using Vital Throw always goes after Macho Brace paralyzed Shuckle using Tackle).

Focus Punch's charge message comes at the very beginning, before even switching.