Reptiles should only be taken out if you live in a rural area, or if you have a fenced in backyard that give you privacy from neighbours. Herps are not dogs, they don't go for walks to the park or anything like that.
You must make sure that your snake stays away from any fence perimeters, nooks, crannies, holes, rocks, etc. They can get away and in to spots you can't faster than you think.
You must be certain that the lawn is free of pesticides and the like.
Do not keep your snake outside for extended periods of time. They can get stressed out, as well as a little UV is good, but the sun has powerful rays these nocturnal animals are not accustomed to being in for great lengths.
I've been taking my animals in to the yard for as long as I can remember. My snakes only spend minutes outside. However, my iguana is housed outside and my tortoise spends most days outside as well. I have never experienced any problems with them picking up any foreign bugs, other than a passing ant.