Good question. The 3rd tiebreaker after head to head and division record is common games. Buffalo and Miami share 8 common games this year:
Miami:
Ravens W
Bengals L
Vikings L
Steelers W
Lions W
Bears W
Browns W
Packers (home)
Buffalo:
Ravens W
Steelers W
Packers W
Vikings L
Browns W
Lions W
Bears (away)
Bengals (away)
Thus far the Bills are 5-1 in common games while Miami is 5-2, so Buffalo has a very slight edge.
If the Bills split with Chicago and Cincinnati and Miami beats the Packers, we would then move to the 4th tiebreaker, conference record. Both the Bills and Miami are currently 6-2. Miami has @LAC, @BUF, @NE, and NYJ. Buffalo has NYJ, MIA, @CIN, and NE. Again, a slight edge for the Bills but ALL of our potential advantages are predicated on the Bills beating Miami in Buffalo. Should the Bills lose, they will likely need some serious help to win the division (and I recognize that your question assumes the Bills will win out in their division games).
5th and 6th tiebreakers are strength of victory and strength of schedule. If it got that far, Buffalo would be nearly certain to have the edge based on current numbers (Miami SOV .423, SOS .496, while Buffalo is SOV .475 and SOS .537).