It's quite difficult to detect "stuck" units but I imagine some kind of system could be thrown together.
In this case maybe have a trigger that runs after a worker begins or finishes construction depending on the build-type.
After it's begun/finished construction, create a "dummy" unit at the Worker's current position, then store the position of the dummy in a point variable, then remove the dummy unit, and finally move the worker to the stored point.
Note that when I say dummy unit I don't mean a unit with the Locust ability. In this case the dummy unit should have no abilities and a large collision size (64+).
So if the Worker is stuck like in your picture, the dummy unit will be created on top of it, but Warcraft 3's pathing system will kick in and shove the dummy unit to a nearby pathable point. This nearby point should hopefully be somewhere that won't get the Worker stuck again. Finally we remove the Dummy so it doesn't get in our way and move the Worker to that Point, hoping that we're no longer stuck (that is if we even were in the first place). It's not perfect but it may solve the issue most of the time.
The problem here is that it may offset the Workers too far from the structure which may be less than desirable. A potential solution would be to compare the Distance between these 2 units before you move the worker.
For example:
If Distance between Worker and Dummy is > 128 then Move the Worker, otherwise don't move it.
The actual value would probably need to be played around with. With this design you may not have to move the worker at all, since if the Dummy is close to the Worker then that implies that there was plenty of room and the Worker isn't stuck.
Also, you'll probably want to use SetUnitX/Y for the Worker when moving it so you don't interrupt it's orders. This way it'll continue building the structure even when moved.
Edit: I forgot that you can't get the Constructing Worker... You'll need a system to find the worker as well... Not so simple lol.
Edit 2: Attached a map with an example of what I described. It actually works pretty well, try it for yourself.
Mess around with the PD value, a lower value will make the Unstuck checker more strict. The more strict it is, the more likely it will try to move the Worker somewhere "pathable". You can also mess around with the size of the Pathing Checker unit. I imagine there's a sweet spot for these values but what I have it set to now seems to work just fine.
If you were to try and import this into your map there's a few things you need to know.
1) It's using a Unit Indexing system which requires the uDex ability (see Object Editor), this ability MUST have the rawcode "uDex". If you copy and paste it into your map, you NEED to set it's rawcode to "uDex".
2) It uses a custom unit called Pathing Checker (see Object Editor).
3) If you already have a Unit Indexing system in your map then I'll need to make a different version of this map that's compatible with it.