From the sound of it you still have some time before your ballon payment is due. With a credit score in the 500's you'll probably find it challenging to get a good refinance. A high credit score will help you get the best programs and rates for your refinance.
My suggestion is to take steps now to improve your credit scores before you attempt the refinance. Most of the time you can significantly improve your credit scores in about 4 to 6 months with the right help and by taking the right actions.
Just be careful. You are in a vulnerable situation and may not be aware that there are people who claim to be credit repair specialists but in realtiy they are only in business to prey on people needing the improve their credit scores. Consult with some people you trust and ask them for referrals to legitimate credit enhanement businesses.