Scripting Grease Pencil and choosing data layer to be linked
I'm not sure if this is what you are looking for but:

bpy.context.scene.grease_pencil = bpy.data.grease_pencil['GPencil']


will set the scene's active grease pencil datablock to be 'GPencil'.

I found this by using autocomplete in the Python Console to see properties of the Scene.

As with other datablocks in blender you can also set scene.grease_pencil to be None to have no active grease pencil datablock.