(not that you should take advice from random strangers on the internet, but) that sounds like classic ADHD hyperfocus to me. Giving a name to it might help in figuring out how to maximize its benefit.
I experience the same hyperfocus, but I don't have ADHD, I'm quite the opposite really.
My background is design and when I was a child I could easily 'get lost' in various forms of art etc for hours. I've met plenty people over the years that are the same, so I'd argue it might be something more aligned with some creative and analytical thought process, and a drive etc to understand/solve the problem at hand.
In terms of where to find the time, there are 24 hours in the day, at least 8 for working the 9-5.