The definition of lining up needs to be expanded to include rotation as well as "shuffling sideways" and also to cover all and only legal close combat contacts.
I suggest that
"Lined up" be defined as :
if in contact, in both front edge and front corner to front corner contact, or in both front edge to rear edge and corner to corner contact;
if not in contact, positioned so that a hypothetical move straight ahead to contact would end lined up in contact.
Then "lining up" is any move that ends with the element lined up.
That should cover all cases of being TZed from flank or rear and all orientations of the element you are lined up with.