You can block off an area on a surface so it is not affected by the script painting you do. When you apply brush strokes over the area, the vertices on the area remain unchanged, regardless of the script paint operation.
For details, see Restrict an area for painting.