Markup gui control via script

Would like to be able script the (a)options to snap at stl, (b) enable length measurement and (c) resample (with defined no. of points) via the markup module? please advise.

All these options can be configured by calling Set... methods of the MRML node (markup node or its display node). See more details and examples in the PerkLab Slicer Programming tutorial.