Yes there is setting you could use, but not with the Brush tool. Select the Clone tool instead, then in the Tool Options choose a brush shape, set the Source option to "Pattern", and Alignment to "Aligned", and choose a pattern to paint with from the Patterns dialog.
There's also another technique. You could fill a layer with a pattern, or even just open ...
Python "scripts" are technically plug-ins, not scripts, so they got in the "plug-ins" subdirectory.
On Linux, they should have the executable flag set
They have to "register" with Gimp (they make one or more calls to the register(...) functions
Typical debug technique:
Add a bunch of print statements, typically:
a wide print '*********************' at ...
There was a plugin in the GIMP plugin registry that did this. It's archived here now.
Some time ago I translated this to Python and it ran a lot faster.
Here's the result of its application to the image in the original question:
Here's the result of its application to the image in Alan's answer:
Anyway here's the code of the plugin:
from __future__ ...