Adding components and modifying properties of UBlueprint asset?

It sounds like you just need the functionality provided by the Blueprint/Add Script button that shows up in the details panel for a selected actor, but to control programmatically which actors to apply it to?

You can invoke this very easily through FCreateBlueprintFromActorDialog, but presumably you won’t want a dialog popping up for each actor. You can see though in CreateBlueprintFromActorDialog.cpp that it is basically just calling FKismetEditorUtilities::CreateBlueprintFromActor(). If you need more control over the blueprint, this class provides some other useful functions, such as AddComponentsToBlueprint().