Congratulations on combining the two codes. That is a good first step.
The problem you are encountering is that runMatrixAnimation() was designed to be used in loop all by itself and called many times each second. As you have the structure now, it is called once when the MD_Test code is run and then MD_Test runs again.
You will need to make the following changes:
change the function definition to
boolean runMatrixAnimation(void)
At the end of the function, you need to add in this line before the last closing brace ('}') to let the calling program know when the animations are all finished.
return(state == 0 && !bInMessages);
and in the loop() change the call to runMatrixAnimation to run until it has finished
while (!runMatrixAnimation()) ;
Please note I have not been able to test this so there may be a need for you to debug this.