When the legal fee is $125/hr, an attorney on trial can easily run up a bill of $1,000/day just being diligent between the actual trial and the preparation for it. $4000 in advance of trying a case is not a bad price – of course, it would depend on what area of the country you live in.
Why not ask the atty what your chances are. S/he knows the entire story, is familiar with the prevailing judicial decisions in the community.
The 2 standards you face are whether there is a present danger to the child and what is in the best interests of the child. Is the boyfriend under treatment or medication – that could negate the sex offender threat. No judge is going to give you sole custody solely because mom works a menial job and you make more money. Judges recognize that children benefit from being around both parents.
Why haven’t you gotten an order to force her to abide by the visitation. When you pick up a child, have a neutral third party observe – like a member of the church (there were earlier posts on this). That why, if she objects, you have a neutral witness.