Fixed the horizontal check and improved vertical check.
I was just thinking too complicated, trying to make smart loops, but could have instead just used brute-force conditions.
Which I did now, inspired by alextro .
Same link, different file: Download here
One last thing that I need to figure out is, why the dictionary with the supposed check results always contains only one key when moving to the "win" layout.
But that's not important.
Important is that the main engine runs now.