This is a problem that lies deep in the architecture of the program and thus isn't that easy to solve.
When you are doing an operation, in any program, and the GUI of the program freezes during the calculation, this is a pretty good indicator that the calculation has been done on the rendering thread. This is easy to implement and works well as long as the calculation returns in a small enough amount of time.
The better way is to start any calculations in a new Thread. If it is done so, the GUI thread can "monitor" the calculation thread and eventually kill it if it takes too long. Blender does this for rendering, baking, compositing and some more: Their progress is shown at the top with an icon to stop the action.
But it is way harder to set up in code. You need to:
- Start a new Thread and assign its task
- Repeatedly ask the Thread its progress and show it to the user
- This means that the Thread has to calculate its progress somehow
- Eventually kill the process after timeout or on user interaction
- Show results of the operation if there are any
The problem lies a bit deeper, in how rendering is done in a loop and how variables are stored, but it doesn't matter.
Also, most of the calculations are some Python scripts with their own API. I don't know how the scripts integrate into the code, but it's pretty sure that it makes things even more complicated.
So, yes, in theory, there is a way to make Blender handle long calculations well. But it hasn't been implemented (yet?) and would require a great amount of time the devs probably won't spend, sadly.