Yes, make the purchase price the loan balance + 15k + the amt you are paying to bring it current. This will bring your tax basis in the property up, thereby minimizing gains when selling. The contract can state that the $7k will go directly to the lender to bring the loan current.
I have a case where an owner is in foreclosure and I want bring the loan current and buy the house from him subject to the existing mortgage but the owner wants about $15k and I am willing to pay it since the home has lots of equity. But how best to put that in the contract that I will take it subject to AND pay him $15k AND somehow state that I payed the $7k to bring the loan current? I want to make sure everything is spelled out for CYA of course or am I over analyzing this??