Any municipality or county may allocate and expend funds for:
(1) Undercover work done in connection with an attempt to apprehend a violator of this chapter; or
(2) A purchase of a controlled substance when purchased by a law enforcement officer for the purpose of apprehending a violator.