Hi
If a pattern is tiling on your image you can find it fairly easily by duplicating the layer - setting the blend mode of the top layer to difference then dragging the top layer across and down until it turns completely black. At that point it is repeating
Then drag across a couple of guides and read the tile size from the ruler (see example below)

However , the script does not have to tile across the layer. Each small sub pattern in the example you gave can be in any of 2 rotations in a block of 4. So if your layer only has room for a block of 2x2 as below then there are 2x2x2x2 = 16 different ways of arranging those sub tiles.

If you have room for 16 across x 16 down then that can be arranged in 2^256 =1.15 x10^77 (i.e. approx. 1 with 77 zeros after it). So that pattern may well not repeat i.e. be tiled on your layer.
The numbers get even bigger use the random brightness and color options.
Of course if you need to make a tile for use elsewhere you can do so by cutting the pattern where it is a close fit. Using Filter > Other >Offset to move the layer 50% down and 50% to the right, which moves the edges to the centre, then repairing any edges that do not match with the clone tool.
I hope that helps you
Dave