(3) If the defendant has been previously convicted two or more times of a violation of any offense defined in this chapter or Section 415.5, by imprisonment in a county jail for a period of not less than 90 days or more than six months, or by both that imprisonment and a fine of not more than five hundred dollars ($500), and the defendant shall not be released on probation, parole, or any other basis until he or she has served not less than 90 days. For purposes of this section, a representative of a school employee organization engaged in activities related to representation, as provided for in Chapter 10.7 (commencing with Section 3540) of Division 4 of Title 1 of the Government Code, shall be deemed a person required by his or her employment to be in a school building or on the grounds of a school.