It is currently difficult to create wiring loops in magma sequential as the output of a circuit cannot be probed prior to calling it.
One solution to this would be to instead of using call to perform a wire allow assignment of ports.
e.g.:
def __call__(self):
out = self.reg.out
self.reg.in = out + 1
return out
While this specific example can be solved using the prev construct in general it is difficult to construct such wiring loops.