I think it is also partly the busy brain (and when you're worried, doesn't your mind jump from one worry to another?) and counting can help focus. So when he counts to ten, it doesn't keep him focused and calm enough. Perhaps he can count by 3s or 7s to 100, or if he can do fractions count by fractions.

My son created math patterns to fall asleep and discovered the Fibonacci sequence by himself. When we read G is for Googol and got to F, he lit up, because he liked putting a name to something he knew.