Has there ever been a requirement to take a loyalty oath to America to graduate high school?

No, there is an implicit assumption that the Kindergarten Oath suffices for all time

No, you’re not the only one. The article linked to in the OP quotes Ilya Gerner (a writer at Comedy Central), “Nothing says ‘I take this obligation freely’ quite like a state law that withholds your diploma unless you swear an oath.”

*playschool