the API does not support a plane-plane distance measurement since the planes are deemed to be infinite in extent. You can measure a point-plane distance, so for example you could define a centroid from the first substructure's atoms and measure the distance to the second substructure's plane:
substructure_search.add_centroid('CENT1', (sub1, 0), (sub1, 1), (sub1, 2), (sub1, 3), (sub1, 4), (sub1, 5), (sub1, 6), (sub1, 7), (sub1, 8))
substructure_search.add_point_plane_distance('CENT1_P2', 'CENT1', 'P2')
Similarly you could define a second centroid, and measure the distance between the two centroids and the distance between the second centroid and the first plane.
I hope this is helpful.