I believe your correct where the ball goes. So, you definately have some sort of rotary encoder. The 0 ohm resistance confirms that the contacts are not resistive. If you don;t have dieectric grease, a thin coating of petroleum jelly to lubricate the contacts (the entire brown thing) would be good.
Any replacement is like to be optical. This doesn't men you can't get an optical encoder to work.
So how many positions again?
So, you have 20 divits and each time the ball goes between them, you get a detent?
Continuously rotatng, correct?
My hunch says that with this encoder you can't tell direction?
Again, I won't say this
https://www.sparkfun.com/products/10982 would work, but it gives you an idea of what "might" be abe to work.
It just doesn't look like you can figure out it's direction. So, one of the outputs from say the encoder above "MIGHT" work?
Do you have a pic of the PCB front and back of the board tat this came out of?