Post #290: .brush. You can use it in Property, Command and Custom tabs.
In your case you need to use this code in Command tab:
Line Stroke Method:
paint_settings(C).brush.stroke_method = 'LINE'
Anchored Stroke Method:
paint_settings(C).brush.stroke_method = 'ANCHORED'
