NREL has a Measure Writing Guide and Developing Measure Collections guide on the OpenStudio wiki.
You'll want to get familiar with the OpenStudio SDK to learn model object methods.
SketchUp measures are nearly identical to OpenStudio measures, the difference being that you can use commands like runner.inSelection()
to filter objects that are selected in sketchup. This is useful if you want to apply a measure only to a selected subset of your model, e.g. adding/removing windows from specific surfaces.
I'm not aware of any OpenStudio measure writing books or free online trainings at this point.
EDIT (20Jun2018): There is now a book on Building Energy Modeling with OpenStudio by the NREL team. You can also see examples of OpenStudio measures and SketchUp scripts on the Unmet Hours Github page.