This plugin was created as a preparation for use in "Create border step by step" (for the effect: IRREGULARLY SHAPED FRAME).
On basis cross guides (one horizontal and one vertical) - are created 5 layers (4 slices and 1 transparent) and path border (with option of addition of distance) .
If we will use option "Merge layers = Yes" we will receive active selection to mark of added border (alpha to selection).
The basic idea (and the code snippet) comes from the plugin:
Guides_to_path.py by
Tin Tran https://gimplearn.net/viewtopic.php?f=3&t=52&p=62&hilit=Guides+To+path#p62