I think Mark is right, seeing your code would help us in understanding your code.
A simple implementation would be to have for loop that took readings every 10 seconds 6 times that was inside of a while loop. Also inside the while loop would be code that checked the readings from the for loop, if they were stable then the loop stops, if not then wait 10 minutes using something as simple as a Wait (ms) function.
See the attached example for the general idea.
Brian