There are several ways to make pseudorandom sequences available
to mechanisms. The "best" way depends on the details of what
you want to do.
For example, if all you need is a point source of noisy current,
there's no need to write any NMODL code at all. Just use the
Random class's play() method to drive the current delivered by
an IClamp--read about this in the Programmer's Reference
documentation of the Random class.
If you have a voltage- or ligand-gated current, and you want to
simulate channel noise, you still don't have to write any NMODL--
the most convenient strategy is to use the Channel Builder. In
its "point process" mode, the Channel Builder does a very
efficient simulation of channel noise. Very useful for synaptic
noise, hot spots, nodes of Ranvier, somata of small neurons,
membrane patch models.
If you want stochastic variation of synaptic transmission,
where the individual responses follow a deterministic time
course, but their peak amplitudes vary from trial to trial,
see the files in this pkzip archive
http://www.neuron.yale.edu/ftp/ted/neuron/chance.zip