First of all, for background animations I would probably use tile animations as well. Altough I don't know if I would it similar to you, but your solution seems to work. And I have to say this because it was very difficult looking through your code.
Your coding style leaves a lot to be desired. Your code was just not readable. No matter how much comments you put in there it is a big mess. And it was clear from your code that even you lost track. I say this not to make you feel bad, but to give you advice. Because now it looks like you don't want people to understand your code.
1) Use indenting. After each bracket open and/or after each control statement add an additional indentation. You get to know how nested each piece of code is and what it is place is in the grand scheme of things. Especially when the number of lines far exceed the height of the screen.
2) Do not put several statements after one another without a line break. Especially when the line exceeds the width of the screen. After each ';' you start on a new line. An exception to this rule is when the combined statements do not even exceed half a screen and a block of several of these constructs are made more readable. For example:
switch( expression )
{
case x: single_statement1; break;
case y: single_statement2; break;
case z: single_statement3; break;
default: single_statement4; break;
}
3) Use {, }, ( and ) brackets even when the syntax does not demand it to be mandatory. Using it makes the code more readable and understandable. Especially when the single statement is still spread over more lines than the height of the screen. It is best to place everything that belongs to a control sequence between brackets, the expression between rounded to visually separate it from the statements. And use curly brackets to signify a new scope.
4) This point is why I am certain that even you did not always know what you were doing. Avoid double jump/termination statements. I have often seen the following:
statement; statement; statement; break;
break; }
This is a double and redundant "break;" The second break is unreachable and only adds to the confusion for reading the code.
5) Be consistent and do not use ambiguous operators. Personally I like the C++/Java style operators. But GameMaker is not that strict in this matter. However it is best to stay consistent over your code, which also goes for the use of brackets with if-statements. Also I know that GameMaker can use the assignment operator as an equality operator, but this makes the code difficult to read. Especially when you also do not use the rounded brackets in an if-statement. Use the euality operator when comparing expressions.
Remember you want people to understand your code. So make it readable. No it is one big mess and it surprises me that the code works. However I also wonder how much redundant cases are in your code.