How can I add a comment for each flag, on separate lines, in a bash script?
You can evaluate comments before the slash, simply generating empty strings for comments which won't affect your script:
bwa aln \
-n $n `# -n max #diff (integer) or missing prob under 0.02 err rate (float) [0.04]` \
-o $o `# -o maximum number or fraction of gap opens [1]` \
....
I suggest using multiple lines to comment the code before the command. like
# this command uses multiple parameters
# it requires 4 parameters and none are optional with no defaults
# parameters used :
# -q name of the file
# -b size to truncate
# -n new location
# -r recursive
One option is to construct your command in pieces so you don't have to worry about line continuation:
cmd='date' # run the date program
cmd=${cmd}' -d 20130905' # for this date
cmd=${cmd}' +%s' # with output in this format
echo $cmd # review the command
eval $cmd # run the command