I don't like that these comments are two lines below what they refer to. I wasn't sure how to do this, so I played around with my own script and discovered you can do something like the following, which I think would be clearer. The following works as a stand-alone script. So you should be able to break that long line apart and add comments to each line.

if [[ $1 =~ 'y'    # match 'y'
      || $1 == \#* # match strings starting with '#'
      || $1 == ''  # match empty string
 ]]; then
  echo 'matches'
else
  echo 'no match'
fi