Can’t see typos easily here when adding code. There are other typos as well, I did not always spell references correctly. Sorry about these, I was just typing out a quick example and sometimes it happens.
All of the code should go in functions.php. Automating things can sometimes be difficult. You have to way the time it takes to do the automation vs how much time it will save.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users