Nice script.
You might be able to test for the sequence of Actions by getting the list of Actions for a macro. I was just going to post the additional scripting, but then found it a much more challenging task than I original thought. So, here's a complete script as an example.
One Note: Action Names are NOT necessarily an unique identifier of the Action. It is better to use the id property.
Here's a script that will delete the Actions ONLY if they are in the specified sequence.
2017-11-03 17:47 CT
I have removed the script that was posted here because it contains a flaw and should NOT be used.
Please see the updated script in this Macro, which I just posted:
###MACRO: Delete KM Actions in Selected Macro by Name [Example]