You can use the existent SquaredDistanceTo function from nomoveon.kod.  Make sure to call it on the right object though (the user, i.e. entering_obj).