Bash has while and for loops, perhaps more but those are the only two I can think of off the top of my head. You can read more about them in the Advanced Bash-Scripting Guide
Also, bash supports sub-routines. Here's an example of a very simple one
echo "Usage: $0 [directory]"
which can be called like so
test -d "$1" || usage