Have a look at the rhinoscriptsyntax documentation:
https://developer.rhino3d.com/api/RhinoScriptSyntax/
Most of these come with an example. Also, be aware that you must set the script context to target the Rhino document explicitly when baking to it from GHPython (see this thread for instance).