Nice work - with your permission - I will add it to the [root tip] [How To] Basic network know-how and troubleshooting.
When one is experiencing slow network it may as well be a slow dns resolver - this script is quite handy.
I am using bind on a rpi to resolve dns using root servers so I am getting an average of 1s for my current resolver
How about using drill instead of dig? After all drill is default present on Manjaro. as a drop-in replacement for dig.
DIGGER="dig"
if ! command -v $DIGGER > /dev/null; then
$DIGGER="drill"
fi
if ! command -v $DIGGER > /dev/null; then
echo "no capable digger found"
exit 1
fi