Chords built on non-scale tones - Quality of chord

The quality of the chord should be a factor in how BiaB chooses whether the root should be a sharp or a flat. This suggestion applies when:
- When the root of a chord is not a scale tone of the selected key,
- and it falls on one of the black keys on the key you are transposing to.

I based the following suggestions on analysis of all the chords diatonic to the major keys with up to 5 flats and 6 sharps, as well as the V7 of each minor key. As you change the quality of chords from diminished, to minor, to dominant seventh, to major, and finally to Augmented, more and more roots start on flats instead of sharps.

I already requested that if the chord is diminished or half diminished, the root should be sharp, regardless of whether the root is a scale tone in the key

If the chord is Augmented, use flats for the roots.

For minor, dominant seventh, and major chords, use the following for chord roots that are not scale tones:

If the root in the new key is F#/Gb, use F#.

If the root in the new key is C#/Db then
if the quality is minor or dominant seventh, then use C#
else, use Db (for major chords)

If the root in the new key is G#/Ab,
if it is a dominant seventh and it is preceded by D#minb5 then use G# (it is the V of C#min)
if it is minor, use G#
else, use Ab (for major and dominant seventh chords)

If the root in the new key is D#/Eb then
if it is a dominant seventh and it is preceded by A#minb5 then use D# (it is the V of G#min)
else, use Eb (for minor, major and dominant seventh chords)

If the root is Bb/A#, use Bb.