A widget can't have weird behaviour because it only takes a player's units into account
If you want to implement it, you can look at unit_shield_link.lua gadget, there is an example how you can handle shared units.
Ticks or Roaches should only chase slower units, they should explode instantly against faster units.
They should only explode/chase if either a metal quantity limit is reached or they are decloaked and a faster unit try to run away.
Jump or fly abilities should count as faster (because vertical distance reduces damage)
If you can do all this, it would be good.
It would be even better if you can overwrite the "maneuver" move state with this behaviour and let the "cloaked hold pos" widget set them on maneuver instead (and only if they are on roam)