Mistake in 1f680c3859
Fix that by moving the grease pencil processing into the existing
`modify_geometry_sets` loops instead. And then make a few small
changes to reduce the amount of boilerplate lines that introduces.
Pull Request: https://projects.blender.org/blender/blender/pulls/137732