This is probably the easiest way, since i don't think there is an Event Response for the constructing unit;
Trigger:
Remove Peasant example
Events
Unit - A unit Finishes construction
Conditions
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Town Hall
Then - Actions
Unit - Remove (Random unit from (Units within 300.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Unit-type of (Triggering unit)) Equal to Barracks
Then - Actions
Unit - Remove (Random unit from (Units within 240.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game
Else - Actions
Unit - Remove (Random unit from (Units within 140.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant))) from the game
This is not optimal, as there is a degree of randomness in it, but it shouldn't cause too much trouble, after all, it only removes the type of worker you choose. If many peasants are building the structure, one of them will be removed (and usually it's the one building, because of how the workers are set up near the building). The different ranges are just because some buildings are bigger, and you don't want to have too big of a range when not needed. That could result in a Peasant running by being removed. You can play around with ranges some more, and add buildings to that list, if you need to.
Right, i thought you just wanted the workers to disappear for some reason. Maybe for what you want a better solution would be;
Trigger:
Remove Peasant example
Events
Unit - A unit Begins construction
Conditions
Actions
Unit - Remove (Random unit from (Units within 150.00 of (Position of (Triggering unit)) matching ((Unit-type of (Matching unit)) Equal to Peasant undead))) from the game
Just make whatever worker you use to be Undead (in Object manager, race), so the building will finish itself after the worker is removed. Then you can add perhaps your own special effects to make it look better.
If you set the Wisp's race to Undead, the classification of the building does not matter, however it might cause some unwanted complications, like healing related (holy light etc.). If the Wisp's race is default, Night Elf, then the building classification has to be ancient, or the Wisp will remain behind, and will not be removed.
I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
I'm on a page about incorrect corrections, and spent the better part of like two hours trying to get someone to understand that -5^2 = -25, not 25, and then that post had comments get reposted because that group is self sustaining, and that person was in turn trying to explain what I just explained to them. And I'm taking that as a victory