This is effectively a missing part to the change that made locate_or_build_portal() enforce that portals only link together in mutual pairs. As target portals that didn't need to be located or built we not being updated to link back to where the player travelled from.
Also
* implements events: on_run_wormhole, on_extinguish
* adds a lot of debug info