Transform Standard OPC Tags into UDTs

I have a OPC client tag program which is synced with my plants P&ID list of equipment.

For programming certain alarming behavior which requires "memory" (Incremental/Decremental trend of the last e.g. 5 values of the sensor) or "time" (Incremental/Decremental trend of the last e.g. 5 minutes of data of the sensor) I decided to also have a UDT definition for my sensors that has custom tags that make those calculations for my alarming system.

Is there a way to write a script in, for example, "Gateway Events/Startup" to automatically initialize a new folder which transforms standard tags into the UDT i defined so that I can use the UDTs for alarming?

I'm a bit confused what you're asking for. You have a UDT definition and you have some standard atomic tags, and somehow you want to convert the atomic tags into instances of your UDT definition via script? Of course you can creat tags via script, but we'll need more info and clarification on exactly how you want to convert those atomic tags

Yes i want to migrate from atomic tags to UDTs to implement the per tag logic based on "time" and "memory" for my alarming system.