Create a component dynamically with type selected in the inspector

I want to be able to do something like this:

[SerializeField]
MonoBehaviour run;

void Start()
{
    gameObject.AddComponent(run);
}

You can select the run script by dragging the script file into the field from the inspector.

Is there a way to achieve this?

Apparently there is this type called “Monoscript” which does exactly this.