I would recommend using a Configuration Profile instead of trying to script it? The only reason to use a script is if you want to allow the user to change the setting later.
See this document on how to use Jamf's Custom Application payload to configure Edge.
This would be accomplished through a configuration profile. Here is an example of what I use to set the default homepage and new tab page in Edge. This is a configuration profile with the Application & Custom Settings configured:
Preference Domain: com.microsoft.Edge
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>HomepageIsNewTabPage</key> <false/> <key>HomepageLocation</key> <string>https://yourhomepagehere.com</string> <key>NewTabPageLocation</key> <string>https://yournewtabpagehere.com</string> </dict> </plist>