Great work that you are doing here :D.
The thing about advanced collision detection or any technical aspect of programming is getting it done right.
To do so, you must separate the mechanic you want, then make it in a separate environment, then test it then port it into your game.
in this case, you want to make a separate SAT collision demo first then implement that into your game.
Take a look at the interactive demo HERE.
However in your case,
since you only have squares why not choose a simpler approach?
You don't need to go for SAT, because if your "squares" are all going to be laid nice and pretty horizontally, then you have no need for diagonal or any other collision test for rotated shapes.
Why don't you try AABB? Youtube
If I were you, I would put square walls at the edge of map.
AABB is a very simple and popular technique. You would be able to find abundance of resources to learn it.