I sketched this up very quickly - so all is subject to check.
2D random walk generally is simple:
walk = Accumulate[RandomReal[{-.1, .1}, {100, 2}]];
Graphics[Line[walk], Frame -> True]
Confinement to square region {{0,1},{0,1}} would simple in principle with Mod[walk,2]
(periodic boundary conditions) but visualizing will be hard:
Graphics[Line[Mod[walk, 1]], Frame -> True]
So I think logical, for periodic boundary conditions, to place it on a torus ( with arbitrary radiuses ):
map[φ_, θ_] = CoordinateTransformData["Toroidal" -> "Cartesian",
"Mapping", {r, θ, φ}] /. {\[FormalA] -> 1, r -> 2 Log[2]}
walk = Accumulate[RandomReal[{-.1, .1}, {10^4, 2}]];
Graphics3D[{Opacity[.5], Line[map @@@ walk]}, SphericalRegion -> True]