Thanks to @zayedupal's answer, this is my final code to automatically create a GameObject, Components and automatically add a UnityEvent.
[MenuItem("GameObject/Create Animation/With SFX", false, -1)]
static void CreateAnimationWithSFX()
{
GameObject go = new GameObject("animationWithSFX");
go.transform.SetParent(Selection.activeTransform);
AudioSource audioSource = go.AddComponent<AudioSource>();
audioSource.playOnAwake = false;
// Automate-add the right channel for audio source
AudioMixer mixer = Resources.Load("Master") as AudioMixer;
audioSource.outputAudioMixerGroup = mixer.FindMatchingGroups("SFX")[0];
SceneAnimationEvent script = go.AddComponent<SceneAnimationEvent>();
// Automate-add the unity built-in function into UnityEvent
script.Events = new UnityEvent ();
UnityAction methodDelegate = System.Delegate.CreateDelegate (typeof(UnityAction), audioSource, "Play") as UnityAction;
UnityEventTools.AddPersistentListener (script.Events, methodDelegate);
Undo.RegisterCreatedObjectUndo(go, "Create " + go.name);
Selection.activeObject = go;
}