Matrix elements for the particle on a ring

$x$ on a ring is really the angle "$\theta$'' which has to be identified $\theta \simeq \theta+2\pi$. Consequently $\theta$ is not single-valued, and cannot act as an operator on the Hilbert space of periodic functions. In particular if $\psi(\theta)$ is periodic --- meaning that $\psi(\theta)= \psi(\theta+2\pi)$ --- then $\theta\psi(\theta)$ is not periodic. As a consequence the matrix element $\langle n|\theta|m\rangle$ is not definable.

I really like this question, I'm probably going to give it as an exercise sometime, once I've completely understood it. That being said, I'm still a little unsure if my answer is correct, so feel free to comment.

I assume that you have chosen the Hamiltonian to be $$\hat{H} = \frac{\hat{p}^2}{2M} = -\frac{\hbar^2}{2M}\frac{\text{d}^2}{\text{d}x^2},$$ where $\hat{x}$ is the "usual" position operator. I do not think this is correct. There is a hint of this even in your question, as your variable $x$ is not quite the position, as it goes from $0$ to $2\pi$. In fact it is the polar angle $\varphi$. While it might look like it should be, I think there is nevertheless a fundamental (topological?) difference between the free particle and the particle on a ring. (i.e. Even if you were to assume that $x$ were the position along the circumference, I do not believe it is equivalent to the one dimensional free particle.)

I believe the correct Hamiltonian for this system is $$\hat{H} = - \frac{\hbar^2}{2 M R^2} \frac{\partial^2}{\partial \varphi^2} \equiv \frac{\hat{L}_z^2}{2 M R^2}.$$

The wavefunctions therefore are $$\psi_m(x) = \frac{1}{\sqrt{2\pi}}e^{i m \varphi},$$ which are eigenfunctions of $\hat{H}, \hat{L}_z,$ and (in this case) $\hat{L}^2$. (The above state would crudely represent a particle spinning "rightward" or "leftward" if $m$ is positive or negative respectively.)

The sort of commutator that you want to calculate will therefore be $[H, \hat{\varphi}],$ where $\hat{\varphi}$ is some sort of "angle" operator. But such an operator is not single-valued, and as a result there are many problems with defining such operators in Quantum Mechanics, as illustrated by this fantastic and understandable paper by Levy-Leblond Who is afraid of nonhermitian operators? A quantum description of angle and phase.

Consequently, I do not think you can use any of the above relation in the case of a particle on a ring.