I think you would do this with a startup task. See @smarx's answer here: Modifying machine.config on Azure compute instances
A batch file running appcmd is probably the easiest way to do it for IIS settings.
Some resources:
MSDN: How to Define Startup Tasks for a Role
Azure: How to execute startup tasks for each site entry at webrole?
Utilizing the Power of Startup Tasks in Your Windows Azure Web Role
And, specific to managing machine.config from a startup task:
https://github.com/Aaronontheweb/azure-webroleperformance-scripts