Ours is simple in comparison to what you are after, but here's what we're using:
In our incident module, we use a decimal attribute called "Work Effort" which is on our Resolution window. We've made this a required field so when a incident is reoslved, the analysts have to fill this in.
The attribute is set to use 1 decimal place. Therefore, 1 hour would equal 1.0 in the work effort field. 40 hours would eqaul 40.0
Here's some screens of how we have it setup:
In Object Designer:
Our Resolution Window:
Hope this helps!
This is not really an app suited for tracking hours in an automated way. ServiceDesk bases everything on data that is manually input or the time stamps of process actions. Unless there is some kind of trigger, such as an email being sent or a user action click, there isn't anything that will record actual time spent on tasks. For SLA reporting its tricky enough just to compute the amount of time during business hours that a task was assigned to an analyst (while not in a status of waiting on the customer), and you're clearly looking for a step higher in complexity than that.
If you're not going to rely on the built in time stamps or the analysts to track/input the values themselves, then you're probably looking for a more specialized application for this.
Your "ideal solution" that you mentioned is very good, and on the plus side if you develop that, you'll be able to sell it!
The closest thing in reality that I've seen was a "virtual desktops" type of application that would switch/overlay multiple Windows desktops, with configurable names, etc. The idea was to open one (or a set of related) app(s) on one of these virtual desktops, and then do your work as normal. Then when you switched to a different virtual desktop, the amount of time you just spent on that one was recorded in a SQL database.
So in the end it was possible to report on how much time was spent on each particular set of tasks because they always resided on a certain virtual desktop.
I found this as a demo app with source code and I made some mods to it, but ultimately didn't have the time to pursue it. But the concept, with some sort of additional data tables for associating time to particular task numbers, would provide something close to your ideal solution.
There may be a more mature version of something like that out there on the market. I haven't looked. Like I said, if someone builds it, there will be buyers, because so many people are trying to track work time in a very detailed way. I liked that solution because it didn't seem intrusive, or like it was "spying" on you. (even though it was!)