A two-step process I’ve found works best. First step is to get the desired configuration of the CPE and then set a tag with the desired state. I use Routed and Bridged. The second stage is two different provision scripts, one for bridged, one for routed. Use a preset to kick off the routed provision, and for precondition I use: Tags.Disabled IS NULL AND Tags.Provisioned IS NULL AND Tags.Managed IS NOT NULL AND InternetGatewayDevice.DeviceInfo.SpecVersion >= "1". And a variation of that for bridged devices.
I use tags to know what state the CPE should be in. GenieACS doesn’t have a concept of metadata about a device, so the best way store this information is in tags.