Maybe check this out: Running Blueprints at Editor Startup | Unreal Engine Documentation
Or this: Inject Python Startup Script