Also sprinkle some parts of the code that check how much time it takes to execute it and then takes a different code path if it was interrupted.
What is done here is child's play, the author is clearly not familiar with old-school assembly obfuscation - this code is one script away from being de-obfuscated.