I can't say really, because i haven't got my fingers on a captive goblin in the recent versions, but experiments with redirecting dwarfs through
creature logic circuits were a complete failure: letting a dwarf walk towards a target and re-directing them via opened hatch to block their path and an opened door to offer an alternative:
#####+....#
Start....^#####.target
#####¢....#
pressure plate is linked both to the door and hatch (hatch over a pit), which in .34.11 makes a one-way path: dwarf calculates path across the hatch, but stepping onto the plate opens the hatch and breaks path. Since the door is opened at the same time, the dwarf simply walks through the door (usually without missing a beat) and can return across the hatch, temporarily blocking the path behind them.
In .40.16, the dwarf will step on the plate, then climb into the open space over the open hatch, decide they can't continue because of dangerous terrain, cancels the job (if a job led them here), and consults the job roster for another occupation. They'll also usually drop their job item onto the pressure plate. I haven't found a way to prevent this behaviour - they'll climb onto a pit surrounded by nothing but open space and level floor; perhaps they'd been hanging onto the ceiling? Anyway, if goblins behave anything like that, we'll regretfully have to bury goblin logic. A shame, it was a pretty neat concept. The worse news is that it may require longer, deeper, multi-hatch pits in "goblin grinder" and similar path-interdiction traps.