If I understood the question well, it is ok to assume that the distance between $v$ and the border of the grid is smaller than $L$. Call $n_{u}$ the number of ups, $n_{d}$ the number of downs, $n_{l}$ the number of lefts and $n_{r}$ the number of rights. The number of closed walks is equal to the number of ways you can choose $L$ times between up, down,left,right in such a way that $n_{u}=n_{d}$ and $n_{l}=n_{r}$.
If you fix a value for $n_{u}$, there are $\frac{L!}{n_{u}!n_{u}!(\frac{L-2n_{u}}{2})!(\frac{L-2n_{u}}{2})!}$. Summing up for all possible values of $n_{u}$ from $0$ to $L/2$ you get that the number of paths is:
$\sum_{i=0}^{L/2}{\frac{L!}{i!i!(\frac{L-2i}{2})!(\frac{L-2i}{2})!}}$