Roc,
A couple of suggestions in the general order you mention things. You have left a lot of needed info out before a better answer can be given but this is what I would do given the facts you have stated so far. You need to find out what this property is worth today in as is condition (not what he thinks it is worth or was worth when he inherited it). Then you need to find out the repairs needed. Have a contractor walk through if the other numbers warrant this (which I doubt but I am getting ahead of myself). We also need to know what is owed on both the first and the second. You also need to know is he willing to walk away and give you the deed. Based on what you have said, I assume he will if you make up the back payments and give him an additional 6k for the funeral payoff. If he will deed to you if you give him the money, the next problem is the 17k you are estimating you need to hand over to get the deed. 17k is a lot of money. I would not be handing this over unless the property has mucho equity. How much equity is a personal question for you to answer but I probably would want at least 20% (you didn't state what the property is worth and this means a lot). If the property is low priced (i.e. 60k or under), I would probably be walking away now. But if this is a higher priced home (150k + or near the median of the market or a little above but no more than say 250k unless you live in cali or somewhere else high priced), you may be ok.
Also, this 17k does not include whatever the needed repairs that will probably be needed since he has essentially abandoned this home as of now. You need to find out what he NEEDS, not what he wants. I probably would not be paying 6k for other expenses, again, unless I was getting sufficient equity to make it worth my while.
As far as the back taxes, they are going to have to be paid. If you are paying them current, he better be taking that expense off the price you are paying because that was his responsibility and I am not paying them to be nice guy. If he will not credit the taxes, late fees, attorney fees and any other fees to bring it current by reducing his price this amount, then move on now.
The second also needs addressed. You need to find out what is owed and how much to bring current. They won't be discounting it at this stage unless a short sale on the first is an option but I am not going into that as that would take many more pages than this (and probably is not going to happen based on what you have said so far).
My recommended plan of action would be to get written authorization to talk to both the first and second mortgage and find out where this guy stands. Find out what it will take to bring both current. Find out what is owed in back taxes. You need to also make sure this guy is really the owner and get authorization to speak to the attorney handling this will (don't call him, go see him) and see if it has dispersed or if this person will eventually get it but has not yet.
Based on what you have stated though, this does not sound like a deal at this point. There are too many ifs and buts and not enough concrete info to get anymore specific than the above. But it will be a good learning experience for future deals so do the legwork to learn the process. The required work shouldn't take more than an hour or two give or take.
Remember; don't get attached to any deal or house. This house is a piece of inventory to you as an investor, nothing more. Don't fall in love with every potential deal or you will drive yourself out of this business (and crazy). This is just a widget that needs to put money in your pocket or there is no reason to get involved.
Good luck
Mike C