Help needed to create a plugin for fixing dv clicks

What do you mean by dB value of 0?
0 dB is full power (amplitude 1 or -1) and -inf dB is amplitude 0.
Let’s talk for now in terms of amplitude (-1 to 1). I presume that one sample could be 0.707 the next (drop-out) 0 and then 0.7 again.
This can also be the case for samples under the center line (-0.6 0 -0.8), I guess.
And this happens every 4th to 7th sample? You know, that signal has already lost a huge amount of information. I doubt if the results will be satisfying.
Anyway, here is some sample code with some arbitrary sample values that have such drop outs.

(setf *sr* *sound-srate*)
(setf selected-samples (snd-from-array 0 *sr* (vector
  0.0 .1 0.3 0.5 0.8 0.0 0.7 0.4 0.1 
  -0.3 -0.6 -0.7 0 -0.8 -0.4 -0.2 0.0 0.0)))
(setf correction 
  (diff 
    (snd-chase selected-samples (/ 2 *sr*) (/ 2 *sr*))     selected-samples))  
(setf result (sim (mult 3 Correction) selected-samples))
;; Let's compare the results
(setf before (snd-samples selected-samples ny:all))
(setf after (snd-samples result ny:all))
(setf corr-by (snd-samples (diff result selected-samples) ny:all))
(format t "Before corrected by after~%")
(dotimes (smp(length before))
  (format t "~a    ~a          ~a~%"
    (aref before smp)
    (aref corr-by smp)
    (aref after smp)))

Thats not yet a plug-in, its for demonstration purpose only. Copy the code to the Nyquist prompt, press the debug button and control if the correction somewhat resembles what you have in mind.
If we are on the right way with this solution, there will be no need for loop structures and reading out each sample (that’s very slow and risky in Nyquist).
Snd-chase is a kind of lowpass filter, but not in the usual sense. We use it here to smooth the abrupt changes from high to low and high again within 3 samples.
(If you want to look up any function or command, you can install my plug-in:)
Nyquist/Xlisp Reference