Infection time varies, so most likely Shane wouldn't have turned for many hours. Rick only took his eyes off Shane for a few seconds, to deal with a more pressing threat. It was extreme bad luck that Shane reanimated in those seconds. (Or rather, implausible writing.)