Hack the Proximity code from the Portal Gun, make the gun spawn a "Portal" which deletes itself after a time, kills you instead of teleporting from the small radius and uses the Wrench Events homing projectile code to move you towards the center when you are in the large radius (detection).