Site Pages and Pages library are basically Document libraries in SharePoint. So, Like any other document libraries you can enable content approval for these libraries as well.
You can use SharePoint OOTB Content Approval for such scenario's. To enable content approval follow below steps:
Go to Library Settings
Select Versioning Settings
How To Install React Script Editor Webpart in Modern Sharepoint Sites Step by Step Full Information
Here is the source code from GitHub:
Script editor web part for modern pages ...
I suggest you check if the exists page ServerRelativeUrl is right, and make sure the "Standard" field exists in the Pages library.
The following code for your reference.
string siteUrl = "https://tenant.sharepoint.com/sites/team";
string userName = "firstname.lastname@example.org";
string password = "xxx";
string newPageName = "new1227.aspx";