Thanks for the thorough and helpful answer @BLI !
I was also struggling to figure out exactly what the intention of the original code was, I came up with this code that runs, but whether or not it produces the intended result is not clear to me. Since the input function is called rand, I believe there is some call to cumsum missing on the randomly sampled vector, or some other operation that will cause the input to look like some form of jittered ramp.
using ControlSystems, Plots
w0 = 2 * pi
D = 0.01
Ki = 0.12
s = tf('s')
sys = (Ki*w0)^2 / (s^3 + 2D*w0*s^2 + w0^2*s + (Ki*w0)^2)
Ts = 0.005
tsim = 0:Ts:50;
tval() = rand(range(0, stop = 50, length = 10000))
tvec = [tval() for i = 1:length(tsim)]
ramp(x, t) = tvec[floor(Int, t*Ts + 1)]
res = lsim(c2d(sys, Ts), ramp, tsim)
plot(res)