This is really cool, and would be especially useful for unit testing like the article says!
. . # exit when sourcing [ "$0" == "${BASH_SOURCE[0]}" ] || return 0
echo "Tests for [$0]" . .
this way you'll wind up able to load/source globs of reusable self testing code into the global namespace with ease.
add a [ -n "$1" ] && { undef and exit } block at the top of the file where you document the names you're using as you would in a header.c and packaging your code for reuse becomes easy.
at last count i have 19 such modules in /ops/bash. they are immensely useful to help me remember this atrocious language :)