Gary Anderson hit a magnificent 117 to keep Scotland in their quarter-final against Sweden in the World Cup of Darts.