In general, you should keep moving. But the answer depends on the breed of snake and your distance from it. Some breeds, such as the Texas Rat Snake are very aggressive and might pursue you no matter what action you take. Other snakes remain at rest and watch your movements. In the latter case, as long as your distance from the snake represents no threat, the snake has little reason to move. Still, there are other factors that might influence its behavior. This type of animal seeks cover most of the time. It knows that it is vulnerable to attack when it is in an open, unprotected area instead of hiding in grass. Safe distance is considered at least twice the length of the snake's body. If the snake looks approximately 3 feet in length, stay at least 6 feet away from it.
Inside a garage you cannot safely shoot a snake due to the chance of ricochet. However, you might able to use a pole or rake to place a towel over the snake and then hit it with a shovel after it is blinded. Again this depends on the breed and its length. Try to get assistance from a family member in this situation and use other tools. A powerwasher with 1800 psi or better can flush this critter out of the garage.