Script variables initialization/assignation in the Editor; Is my solution adequate?

So I have dozens of mobs in my game, and now it’s time to add sounds to them ,which led me to get really exhausted by assigning the almost same GO and components references over and over for different mobs. That “almost” bit means that they are all a bit different hierarchies and stuff, so I can’t just select them all and do a bulk reference at once do. And I did the same job for every new component I was adding to them previously but this time I thought about automating it. I sadly didn’t find any “onScriptAttach” callback for a script or something like that, and wasn’t sure how does Editor scripting works, so I just did this.

    public AudioSource TalkAudioSource;
    public AudioSource CenterAudioSource;
    public AudioSource ShootingAudioSource;

    public bool isDying;

    public float dyingSpeed = 5;

    public bool isInitialized;

    public static Transform RecursiveFindChild(Transform parent, string childName)
    {
        foreach (Transform child in parent)
        {
            if (child.name == childName)
            {
                return child;
            }
            else
            {
                Transform found = RecursiveFindChild(child, childName);
                if (found != null)
                {
                    return found;
                }
            }
        }
        return null;
    }
    void OnValidate()
    {
        if (!isInitialized)
        {
            TalkAudioSource = RecursiveFindChild(transform, "head").GetComponent<AudioSource>();
            CenterAudioSource = RecursiveFindChild(transform, "MobCenter").GetComponent<AudioSource>();
            Transform barrel = RecursiveFindChild(transform, "Barrel");
            if (barrel != null) ShootingAudioSource = barrel.GetComponent<AudioSource>();
            gameObject.GetComponent<BaseMobAI>().sounder = this;
            gameObject.GetComponent<MobHealth>().sounder = this;
            isInitialized = true;
        }
    }

And it just works, yay! However that feels kidna lame, like there are some proper method to achieve that. Are there?
Also that bool flag as far as I understand how it works, will go into the game build, which is a bit of littering I don’t like. Or will it be deleted from build since I don’t use it anywhere in ingame method?