Testing the value of Fields stored on Taxonomy Terms
Panels is very good for overriding Taxonomy pages. You can have different page and layout variants per vocabulary, user, theme, site etc. You can then include your code in a custom panel pane for taxonomy pages, together with whatever layout or views necessary, or write your own CTools content type for Panels.