Can I find parametric equations for a curve that is winding another curve, which I know -- let's say it's $\vec{f}(t) = (x(t), y(t), z(t)) = \{\sin (t)+2 \sin (2 t), \cos (t)-2 \cos (2 t), -\sin (3 t)\}$.
(KnotData["Trefoil", "SpaceCurve"] in Mathematica.)
I can do this for an ordinary torus since the radii vector $\vec{r}(t)$ that joins origin and the curve that is being coiled is always perpendicular to the local vector that is doing the coiling as well as to the derivative $\dot{\vec{r}}(t)$. (I'd like this local vector to be perpendicular to $\dot{\vec{f}}(t)$ in the general case above too!) Mathematica image output for example:

With $\vec{g}(t) = \{\cos(t) (0.4 \cos(20 t)+1), \sin(t) (0.4 \cos (20 t)+1),0.4 \sin (20 t)\}$ and 20 for twenty coils.
If it can't be derived in closed form, could you give me some points towards a working algorithm?
The TNB frame can be used for this purpose, unless your curve has zero curvature somewhere. Let $$\vec T(t)=\dot {\vec f}/\|\dot {\vec f}\|, \quad \vec N(t) = \dot {\vec T}/\|\dot {\vec T}\|,\quad \vec B(t)=\vec T\times \vec N$$ and then define $$\vec g(t)=\vec f(t)+r (\vec N(t) \cos kt +\vec B(t) \sin kt )$$ where $r$ is the radius of the coil and $k$ is the desired number of loops. The idea is that $\vec N$ and $\vec B$ form an orthonormal basis of the plane perpendicular to the curve, and $\cos kt, \sin kt$ parametrize a circle in that plane.
Example: winding around the trefoil knot. Made with the Maple code below; translation into Mathematica is an exercise for the reader.
(Need a large value of
numpointsto properly resolve the winding curve.)The thing to worry about with this method is that $\dot{\vec T}$ may turn to zero somewhere, making $\vec N$ and $\vec B$ discontinuous at that point. Paradoxically, the worst case is when the curve is a line: $\vec T$ is constant and $\vec N$, $\vec B$ are not defined anywhere. (I say "paradoxically", because winding around a line is quite an easy thing to do.) I do not have a remedy for this problem. Consolation: it is unlikely to occur for "generic" space curves.