This cuts of all the preceding path elements, just as basename $0 would do.
The ## tries to find the longest matching expansion of the prefix pattern:
$ x=/a/b/c/d
$ echo ${x##*/}
d
$ basename $x
d
From the man page:
${parameter##word}
Remove matching prefix pattern. The word is expanded to produce
a pattern just as in pathname expansion. If the pattern matches
the beginning of the value of parameter, then the result of the
expansion is the expanded value of parameter with the shortest
matching pattern (the ``#'' case) or the longest matching pat‐
tern (the ``##'' case) deleted.
The reason for using ${$0##*0##*/} is that it doesn't involve an external program call, but it is kind of obscuring what is going on.