I have used a library to keep synchronized local folders and contents to the classic Content tool. That means that I have a mirror from the remote folders into my local and then from there I update everything I want in my local. Then I run the php script to upload all the updated/new content. The library is this one https://github.com/salesforce-marketingcloud/FuelSDK-PHP.
However this tool is not supporting Content Builder. But Content Builder has a good feature as a import button that works very well! It recreates all the contents/folders into the Content Builder. Let's say, it mirrors your content Classic content/folder structure.
So, to avoid doing a forever manual updates, You can use that php library. Will require you a considerable effort to accomplished what You need, but once there no more manual updates needed. Not sure if there's a similar library to interact will Content Builder but if exists obviously this would be used to avoid manual updates as well. That means you need to interact with the Content API.
From my experience I have only 2 dynamic emails based on AmpScript. So might be my approach is not useful for you.