There is a much easier way to do this and it’s not limited to pausing/changing filaments per layer. You can print different colors on a single layer.
I have been hesitant to post it here, as I worry BL will break it as they (obviously) want you to buy the AMS.