if there is a real problem in your car, the CEL will keep going on again and again and again, no matter how many times you reset it.
if you need this trick to pass inspection according to your state law, 99% don't count on it. most of the time it's useless, they will have you drive another 50-100 miles to reinspect, which is the milage to trigger the light again.