How to determine ime between pulses that exceed a threshold

I am creating a sound sample that generated by a breaking a beam of light (a photogate system). The sample is generally low noise centered around 0db and a pulse (or close grouping of multiple pulses of various amplitudes) when light beam is broken. The pulse general varies based on the light intensity. I want to find the wall clock time between the subsequent pulses. I reworked the Find Peak Finder plug-in and the Beat Finder plug-in with some success. Does anyone know of a plug-in that might be close to the analysis I am looking for?

For example, on first pulse start timer and ignore samples for certain amount of time. Then find next pulse to stop timer and label pulse with time lag between previous pulse and this one. Repeat basic process for all other pulses. At each pulse I’d like ot label with local time, elapse time since previous pulse (or since start time), and pulse amplitude.

“Sound Finder” and “Beat Finder” are both close - how far did you get modifying them? What doesn’t work?

For peak finder I do not always get the peaks. It seems I need all peaks that exceed a threshold not just all equal to max but I also need to ignore for a window of time after a peak is sceen.

;nyquist plug-in
;version 4
;type analyze
;name "Scrambler..."
;action "Analysing the audio ..."
;control equal-levels "Place labels at" choice "first peak only,all equally loud peaks" 1  
;control minimum-distance "Minimum Distance:[samples]" int "" 1000 1 5000

; no garbage collector messages please
(setf *gc-flag* nil)

(if (< minimum-distance 1)
    (setf minimum-distance 1)
  (setf minimum-distance (truncate minimum-distance)))

(defun make-peak-waveform (sound) 
  (if (arrayp sound) 
      (snd-maxv (snd-abs (aref s 0)) (snd-abs (aref s 1)))
    (snd-abs sound)))

(defun add-label (time text)
  (setq label-list (cons (list time text) label-list)))

(setf label-list nil)
(setf last-peak-time 0.0)

;; The main working part of the program.
(let* ((peak-waveform (make-peak-waveform s))
       (maximum-peak 0.0) (last-peak 0.0))
  (do ((n 0 (1+ n))                                   ; sample counter
       (current-sample (snd-fetch peak-waveform)      ; init-form
                       (setq vowel-sample             ; loop-form
                             (snd-fetch peak-waveform))))
    ; Exit when we run out of samples, return the number of samples (n)
    ((not current-sample) n)
    (cond ((and (= equal-levels 1)
                (= current-sample maximum-peak)
                (> (- n last-peak) minimum-distance))
           (format t "n: ~A, lp: ~A, n-lp: ~A m: ~A~%" n last-peak (- n last-peak) minimum-distance)
           (setf last-peak n)
           (add-label (/ n *sound-srate*) (format nil "local-time: ~A delta-time: ~A" (/ n *sound-srate*) (- (/ n *sound-srate*) last-peak-time)))
		   (setf last-peak-time (/ n *sound-srate*)))
          ((> current-sample maximum-peak)
           (setf maximum-peak current-sample)
           (setf last-peak n)))))

(format t "resulting list: ~S~%" label-list)

; If no peaks were found, return a message
(if (null label-list)
    "No Peaks found."
  label-list)