This type of enemies tries to align themselves with the player.
The alignmentOffset is just a value that represent the difference of vertical distance between the top and the center the player and the enemy. So what we do here is check if the enemy's center is above or below the player's center and simply move the enemy accordingly.
How and there is a typo in you code the second line should read: