I battled some trainers when I arrived at Ruin Valley and then I wandered around the tall grass in the canyon. I encountered and caught a wild Natu and a wild Yanma, then I proceeded towards the center of Ruin Valley and I battled more trainers as I made my way around. I finally entered the Dotted Hole and I went down through some holes in the cave floor until I found the place where the Sapphire was hidden. I was about to pick it up but then a Team Rocket scientist appeared and he took it instead. He fled to the Team Rocket Warehouse and I left the cave too. I headed to the Six Island Pokemon Center to heal my Pokemon, then I went north to the Green Path. I battled some trainers there and saved.