How to find out the average dB value of a track?
To calculate the dB value of a strip, you can use the following code. I've described it in more detail in my attempt to update the VSE docs (see https://vse-docs.readthedocs.io/edit/sound/measuring/volume.html).
For calculating the average dB of a track, you'll have to repeat that code for each strip on the track.
Please also note that there is a difference between average dB and Peak dB. Maybe, it's better in your example to use the peak value (see the docs).
import bpy
import math

strip = bpy.context.scene.sequence_editor.active_strip
depsgraph = bpy.context.evaluated_depsgraph_get()
sound = strip.sound.evaluated_get(depsgraph).factory

samples = sound.data()
m = np.mean(samples**2)
rms =  np.sqrt(m)
db = 20 * math.log10(rms)