Update Project (Merge gateway changes into project) via scripting

Not in any supported way. You can use the free Ignition Extensions module, which adds a system.project.update() function in the Designer.