An 87-year-old pensioner foiled a fraud gang’s “sophisticated” scam to steal thousands of pounds from him, York Crown Court heard.