Simple scripts for styling geometric elements can use element attributes; set element color; and reference symbols, patterns and styles in style objects.
For advanced Style by Script examples using special CartoScript functions to render point and line elements, see also:
CartoScripts
Geologic Map CartoScripts
More CartoScript documentation and examples