[§663E-10]  Defense.  [(a)]  It is a defense to any action brought pursuant to this chapter that the person who possessed, distributed, or facilitated the marketing or distribution of a dangerous or harmful drug did so under authority of law as a practitioner, as an ultimate user of the drug pursuant to a lawful prescription, or as a person otherwise authorized by law.

     [(b)]  A law enforcement officer or agency, the State, or a person acting at the direction of a law enforcement officer or agency or the State is not liable for participating in the illegal drug market if the participation is in furtherance of an official investigation. [L 2004, c 44, pt of §13]