The opponent does pick a random space to move to, then checks if the move is possible. If the move isn't possible, it picks a different space to move to. If it goes through all the spaces but there are no possible moves, the game sets a win for the player.
As for the opponent not following the rules, I'll have to look into that, not sure why he's breaking the rules