A man has admitted trying to kidnap a 17-year-old girl in Swindon in what police described as a "terrifying incident" for the victim.