The square bracket [
indicating the stat of a beam group should be attached at the end of the first note in the group.
So the part:
. . . \bar "||" [ff8 \melisma ef df]
. . .
should be changed to:
. . . \bar "||" ff8[ \melisma ef df]
. . .
Some of the f-flats are not all showing up with flat symbol because LilyPond thinks that you are still in the same bar as a previous f-flat that is marked.
In music notation, an accidental symbol usually effects a note, and all preceding notes in that bar that are in the same staff position.
One option to get more accidental symbols is to use an exclamation point !
directly after a pitch is given.
So the part:
. . . ff16 [ef ff8] gf2 ff4 df8 ef ff2. \bar "|"
. . .
can be changed to:
. . . ff16 [ef ff!8] gf2 ff!4 df8 ef ff2. \bar "|"
. . .
However, there are other ways to deal with this problem such as changing the time signature, or setting a different accidental style.