I've heard of people trying coffee, without much reporting on results, especially not long term. I very briefly tried tea bags many years ago, the experiment didn't last long, they didn't do much to stain a tankful of water at the low input levels I was willing to risk trying. More traditional methods worked a lot better.
That said, I've since seen suggestions in science literature of caffeine causing problems including defects in fry and stress responses in the general fish population, and evidence caffeine creates water quality problems and encourages growth of certain pathogenic or ammonia producing bacteria in a tank. (
article ) Contrast this with more traditional aquatic tannin sources which are often mildly antiseptic.
My understanding (or reading) is this hasn't been extensively studied, so I don't know how conclusive some of this is, but what I've seen is enough for me. At this point, without some strong and authoritative evidence to the contrary, I wouldn't do it.