The teams traded leads four times in a thrilling second half that included seven consecutive scoring drives — four by AFC East-leading Buffalo and three by division rival Miami.