I would also advise seeing a doctor but I'll say my doctor recommended me something very similar. I'm not able to go to the gym but what has helped me is I have a bucket with rice in it (I guess you could also use sand?) and I just twist my hand within the bucket of rice while holding and squeezing a tennis ball in it. Do it in a circular motion.
One thing I thought was interesting is he said that ortho doctors don't really think ergo keyboards help. I use a kinesis advantage 360 where I can (I still prefer a regular keyboard) I don't see much in the way beyond help with shoulder pain. I've had surgery to fix my RSI/ tunnel nerve inflammation. Anyways where I'm going with this is I do think exercise is a big help.