(a) Whenever any person is arrested for any violation of this chapter punishable as a misdemeanor, the arrested person shall be immediately taken before a magistrate or court within the county in which the offense charged is alleged to have been committed and who has jurisdiction of the offense and is nearest or most accessible with reference to the place where the arrest is made, in any of the following cases:
(1) When a person arrested demands an immediate appearance before a magistrate or court;
(2) When the person is arrested upon a charge of negligent homicide;
(3) When the person is arrested upon a charge of driving while under the influence of alcohol, or under the influence of any controlled substance, or under the influence of any other drug, or under the combined influence of alcohol and any controlled substance or any other drug;
(4) When the person is arrested upon a charge of failure to stop in the event of an accident causing death, personal injury or damage to property;
(5) When the person is arrested upon a charge of violating section fourteen, article seventeen of this chapter relating to weight violations, except as otherwise provided in that section;
(6) When the person arrested is a resident of a state that has not entered into a nonresident violator compact with this state;
(7) In any other event when the person arrested refuses to accept the written notice to appear in court as his or her promise to appear in court or to comply with the terms of the written notice to appear in court as provided in section four of this article; and
(8) When a person is arrested for driving with a suspended or revoked driver's license for miscellaneous reasons. Provided, That when a person is arrested for driving with a suspended or revoked driver's license for miscellaneous reasons, the arresting officer may issue a charge by citation if a magistrate or judge is not on duty or reasonably available.
(b) When the person arrested is a resident of a state that has entered into a nonresident violator compact with this state, the arresting officer shall issue the person a written notice as provided for in section four of this article and may not take the person immediately before a magistrate or court, except under the terms of the compact or under the circumstances set forth in subsection (a) of this section.