The dosing schedule itself is safe and reasonable, but especially considering the whole concept of half-life and all that, and since you're constantly using the drug, you end up with a baseline concentration of Xanax that has more or less built up and is constantly floating around your blood. So with that, and the fact that a simple overdose is actually quite a challenging thing to do with benzos, the more relevant question would probably be "how much can I safely take on a daily basis?"
And you've more than likely crossed that threshold. Xanax has a half-life of about 11 hours so it means that after 11 hours, half of the drug is still remaining. After 22 hours, a quarter of the dose still remains, after 33 hours an eighth still remains, etc. As you can probably guess from this information, for a person dependent on Xanax, what you experience 5-6 hours after dosing is just the tip of the iceberg. If you stopped using the drug completely for a few days, it's possible you'd be encountering seizures, which is why I say that your overall daily intake has probably put you somewhere into "unsafe" territory.
As for the logic you use to justify 5 hours, it's a bit flawed. Xanax, like any other drug, especially when swallowed, takes a bit of time to get into your system because, among other things, your stomach needs to break the pill down, absorb the medicine into your bloodstream, etc. For all intents and purposes, the time in between swallowing and when the drug has kicked in doesn't count as part of the duration.
I can see how you might make the mistake between the first and second dose of the day, but since you're taking it 3 times a day, it should be easier to explain. You allow only 10 hours to pass between your first and third dose of the day - that's 10 hours. So even if you could cancel out the first hour where you're getting no effect using the flawed logic, that would amount to 11 hours. An average of 5.5 hours total. Obviously that doesn't line up with the 6 hour duration you think you're taking it for. If you took a 4th dose 5 hours later, that would amount to 16 hours when including that initial hour, giving you an average of 5.3 hours.
To make it even more clear, imagine the extreme example of a drug having a duration of 1 hour, and taking 1 hour to kick in. With the logic you're using, counting that initial hour, you'd end up taking an infinite-sized dose because it would never actually start working! Or if that's too abstract, imagine a drug that somehow has an EXACT duration of 1 hour and 1 minute, and takes an hour to kick in. With a duration of 1 hour and 1 minute, you could expect that if you didn't sleep at all, that'd be about 24 doses in the day. But by reasoning that since it takes an hour to kick in, you should be subtracting that hour from your dosing schedule, you would be taking another dose every single minute. Instead of about 24 doses throughout the day, you're now taking 1,440 = hopefully you can see by now that it doesn't make any sense.
Since the time it takes to kick in should be consistent, if the drug really has an effective duration of 6 hours for you at that dose, it would make sense to take the pills 6 hours apart. So do you take the dose every 5 hours because you start feeling like you need it, or because your math said so? If waiting any longer to dose will send you into withdrawals (though according to your post, if happens when you wait more than SIX hours to dose), then it's reasonable, although still unfortunate that you've gotten yourself dependent on that much Xanax per day. If the reason you're taking it every 5 hours is strictly because you've calculated it out that way, well as I've shown, it wasn't accurate, but even if it was, everybody processes these drugs differently, so even "accurate" math wouldn't be the appropriate way of going about it either. Maybe with a heart medication or something else that's being treated where the symptoms aren't immediately noticeable, but if you're treating anxiety, it's something inherently noticeable and is why you're treating it in the first place (anything else would be as useless as giving somebody painkillers for pain when they don't feel pain), so also since benzos work with just a single dose, rather than trying to reason out how long you should wait to take the next dose, the best way is really just to do it by feeling, even though for many other medications (ie SSRIS) this would be terrible advice. If you only need to take it every 6 hours to avoid significant withdrawals, then you really only need to take it every 6 hours.