OAuth scripting is a hard work to go.
You have to understand Cocoa scripting (Cocoa + AppleScript) .
You have to make a WkWebView on a dialog.
I didn’t find OAuth 2.0 sample AppleScript. So, I whole wrote.
Now I’m planning to write REST API scripting book series.
I may write this series.