Hi Richard,
Thank you for reaching out to the Google Ads Scripts Team. Please excuse us for only getting back now as your message failed to be routed to our support queue.
If you'd like to get keywords at the ad group level, you'd need to iterate through ad groups first by using an AdGroupSelector. Afterwards, a KeywordSelector can be used for getting keywords in the account. You may check this link on AdsApp.NegativeKeywordList for the methods which can be done for adding keywords to a negative keyword list. Kindly note that adding a keyword to a negative keyword list would make it negative. You may also refer to our Google Ads scripts latest documentation for reference.
As an aside, you may try browsing from the ready-made solution scripts and see if any would fit your use-case.
Best regards, Google Ads Scripts Team