Every attorney who, directly or indirectly, advises in relation to, or aids or promotes the defense of, any action or proceeding in any court, the prosecution of which is carried on, aided, or promoted by any state's attorney or other public prosecutor with whom such attorney is connected, directly or indirectly, as a partner, or who takes or receives, directly or indirectly, from or on behalf of any defendant therein, any valuable consideration, upon any understanding or agreement whatever, express or implied, having relation to the defense thereof, is guilty of a class A misdemeanor and in addition to the punishment prescribed therefor, that attorney forfeits that attorney's license to practice.
27-13-12. Attorney not to aid defense when formerly interested as public prosecutor - Penalty. Every attorney who, having prosecuted or in any manner aided or promoted any action or proceeding in any court, as state's attorney or other public prosecutor, afterward, directly or indirectly, advises in relation to or takes any part in the defense thereof as attorney or otherwise, or takes or receives any valuable consideration from or on behalf of any defendant therein, upon any understanding or agreement whatever, express or implied, having relation to the defense thereof, is guilty of a class A misdemeanor and in addition to the punishment prescribed therefor, that attorney forfeits that attorney's license to practice.
27-13-13. Public prosecutors or partners thereof may defend themselves in criminal or civil actions. Sections 27-13-11 and 27-13-12 do not prohibit an attorney from defending oneself in person, as attorney or as counsel, when prosecuted either civilly or criminally.