Well, your scheme coding skills are waaay better than mine... I'm assuming you actually know scheme!
The only thing I don't get is what this bit a the end is for:
I think the same could be done with a simple erode and invert.
(plug-in-sobel RUN-NONINTERACTIVE image layer 1 1 1)
(let ((select-point (screen-coordinates '(0 0))))
(car select-point) (cadr select-point)
1 CHANNEL-OP-ADD TRUE FALSE 0 FALSE))
(gimp-edit-bucket-fill layer FG-BUCKET-FILL NORMAL-MODE 100 0 FALSE 0 0)
One other suggestion would be to have the user specify the brush size rather than using the 12 px brush.... You'd also have to space the random walk step size proportionately, of course.
The code to programmaticly define a hard edged brush is:
and then destroy after use by:
;Set up Brush
(set! brushTemp (car (gimp-brush-new "MyBrush")))
(gimp-brush-set-shape brushTemp BRUSH-GENERATED-CIRCLE)
(gimp-brush-set-hardness brushTemp 1)
(gimp-brush-set-radius brushTemp varRadius)
(gimp-brush-set-spacing brushTemp varSpacing)
(gimp-brush-set-spikes brushTemp 2)
(gimp-brush-set-aspect-ratio brushTemp 1)
(gimp-brush-set-angle brushTemp 0)
(Of course this would also let you vary the brush size in a random walk itself! just call the gimp-brush-set-radius whenever)