Here’s a version that works with stereo tracks. It still has the 100,000 sample (per channel) limitation, but as Edgar explained, this is a limitation of the (fmosc) function and is hard coded into Audacity.
(setq initial-speed 1.0) ; Hz
(setq final-speed 5.0)
(setq initial-depth 10) ; scale of 0 to 100
; values greater than 100 will produce extreme vibrato
(setq mid-depth 100)
(setq final-depth 20)
(setq mid-pos 30) ; position of the 'mid' point as % of the selection length
; 'mid' point of 30% is about 1/3 of the way along the selection
(setq initial-speed (/ initial-speed 2.0)) ; 1/2 the vibrato speed
(setq final-speed (/ final-speed 2.0))
(setf vib-speed (pwlv initial-speed 1 final-speed)) ; the vibrato speed envelope
(setq initial-depth (/ initial-depth 100.0)) ; changes scale from % to a scale of 0 to 1
(setq mid-depth (/ mid-depth 100.0))
(setq final-depth (/ final-depth 100.0))
(setq mid-pos (/ mid-pos 100.0))
(setf vib-depth (pwlv initial-depth mid-pos mid-depth 1 final-depth)) ; the vibrato depth envelope
(defun vibrato (s-in)
(setf *s-table* (list s-in 0 nil)) ; makes the sound 's' into a wavetable
(fmosc 0.0 (mult vib-depth (fmosc 0 vib-speed)) *s-table* 0))
(setq *float-format* "%.2f") ; set printed output to 2 decimal places
(if (> len 100000)
(format nil "ERROR~%Selection length too long.~%Maximum length at ~a Hz (sample rate) is ~a seconds." *sound-srate* (/ 100000 *sound-srate*))
(multichan-expand #'vibrato s))
Toward the end you’ll notice an (if) structure. This checks the length of the selection before processing and outputs a meaningful error message if the selection is too long.
You may be interested to compare this code with the plug-in version that I’ve posted here: https://forum.audacityteam.org/t/vibrato/18944/1
The plug-in code can be opened in any plain text editor (such as NotePad), though for writing Nyquist scripts I would highly recommend using a plain text editor that supports bracket matching (such as NotePad++).