Take a look at the fixed frequency oscillator model in
http://www.designers-guide.org/Analysis/PLLnoise+jitter.pdf.
You don't need any kind of loop statement at all. That is not the way the analog section works. It is run on every time step. So you instead you use @(timer(...)) to avoid executing statements that update the state of the model except at the desired points in time. So you would using something like ...
Code:@(timer(next)) begin
state = !state;
next = next + period/2;
end
V(out) <+ transition(state);
-Ken