If I understand this correctly, you are checking whether 2 spots are taken up in any row, col or diagonal.
This can be simplified to checking the adjacent spot. So for corner spots such as ,  etc check the adjacent spot in the row col and diagonal. For spots such as , , , and  you only need to check the centre spot because the others have been checked when you did the corners.
Adjacency can be achieved by adding or subtracting 1 from the Row or Col variables.
So the whole thing can be done with nested for loops and an adjacency function. Same thing for checking for a win.
Hope this helps.
BTW this is the first time I have seen anyone using $ as part of a variable name. It's not illegal or anything - just unusual.