there is a flipline tool, though it doesn't seem to allow queries on a feature. it may be that you can provide the tool with a feature layer based on the selected attributes.
EDIT: As @JasonT mentioned, the flip tool should honor selections, so perhaps use make feature layer with a SQL clause on the features that should be flipped and pass that layer to flipline.
from the link above:
from arcpy import env
except Exception, e:
# If an error occurred, print line number and error message
import traceback, sys
tb = sys.exc_info()
print "Line %i" % tb.tb_lineno