/Engine/Source/Editor/UnrealEd/Public/Kismet2/BlueprintEditorUtils.h
Searches the world for any blueprints that are open and do not have a debug instances set and sets one if possible. It will favor a selected instance over a non selected one
static void FindAndSetDebuggableBlueprintInstances()