Efficiency might not be my strong suit, but here is the process I came up with:
In the code below, I first create a point feature class from the vertices of my input shapefile. From here I iterate through each feature in the input shapefile. I select each vertex in the point feature class associated with that feature, and then perform a distance selection. After unselecting the original feature points, I iterate through my remaining point selection and check if two are selected with the same original FID field values. If so, I have indicated where in the code you can perform further geoprocessing. I'm curious what further geoprocessing you are planning on implementing. I might be more efficient to do so outside of the nested loop.
Below, 'inputFC' is a string of the full path of your shapefile. Make sure you have the 'r' before your open quotes. 'distance' is the distance you are using.
inputFC = r"C:\GISStuff\input.shp"
distance = "100 Meters"
#Create points from input feature
arcpy.FeatureVerticesToPoints_management (inputFC, r"in_memory\points")
#Create layer files to allow selection
arcpy.MakeFeatureLayer_management (r"in_memory\points", "pntlyr")
#Create cursor for table access
cursor = arcpy.da.SearchCursor (inputFC, ["OID@"])
for row in cursor:
#list to append first point per OID to
onePntli = 
#list to append second point per OID to
twoPntli = 
#SQL to select points by original OID
sql = '"ORIG_FID" = ' + str (row)
#Select points for feature
arcpy.SelectLayerByAttribute_management ("pntlyr", "", sql)
#Select neighboring points
arcpy.SelectLayerByLocation_management ("pntlyr", "WITHIN_A_DISTANCE", "pntlyr", distance)
#Remove original feature points from selection
arcpy.SelectLayerByAttribute_management ("pntlyr", "REMOVE_FROM_SELECTION", sql)
#Check for selection:
if arcpy.Describe ("pntlyr").FIDSet:
#cursor to iterate through selected points
pntcursor = arcpy.da.SearchCursor ("pntlyr", ["ORIG_FID"])
for pntrow in pntcursor:
#If one point has been found but not two...
if pntrow in onePntli and not pntrow in twoPntli:
#Add ORIG_FID to list indicating two points have been found
###!!!Further Geoprocessing here!!!
### variable pntrow contains the OID of the neighboring polygon
### feature to be geoprocessed
#If this is the first point found with given "ORIG_FID"...
#Add pnt "ORIG_FID" to list
I hope this helps.