This is a really hard question to answer in a short response.
I depends on what level your at, but I think it's VERY important for the producer to know how to record and know recording techniques just as good if not better than the engineers that may work under him/her.
At a more indi level you see a lot of producers who are also playing the engineer role, but it's really one of those things where it's great to have cross training. You NEED to know how to record well to produce well, and you also NEED to know how to produce to really make sure your getting the recording sounds you want. Now that doesn't mean there aren't going to be people with one way better than the other and vice versa, but a GREAT producer is going to know how to get your vocals to sound right, how to get the most out of your songs and how to get great tones and mixes, even though they may have an engineer working the stuff for them while they direct the situation.
Sorry I guess that got off topic from the original question. Whether or not a producer gets writing credits really depends on what they are doing and what the deal is when you go in with them, usually producers get a set amount of points in general for their cut, however if they are in there and lets say you have a producer who writes a KILLER guitar hook, or changes your vocal melody and a few words to get the most out of your song didn't they just help WRITE the music? The reality is your paying for that trained in one way or another, whether it's up front or on the royalties side of thing. Some people go by that saying, write a word get a third, I think thats a bit extreme but you get the general idea. As long a the producer is happy with the deal prearranged then its all good.
A couple things to remember when dealing with this stuff, generally try and get it worked out upfront even if someone says we'll do it on the back end, or they don't want anything, NO don't listen!!! Trust me from personal experience, I don't care how well you know them, how good of a friend or family they are, when the end of it comes and you have a product and people see that there is potential these things can change... and also a lot of times people don't realize the amount of work they are agreeing to commit to and end up doing a lot and then feel like they got stiffed even though they agreed to something early on. Do it up front!!!! Get it in writing and be done with it so you no longer have to worry about and theres no issues at the end of the day. Also remember when someone wants a cut of something if its going to elevate your band to that next level it's a sacrifice your going to have to make early, keeping 100% of nothing is still nothing, getting 50% of a few 100k aint so bad.
Hope this helps answer your question.
Dallas