Buying just a title and then trying to title & register a different bike with it is a felony, punishable by 1-5 years in jail and up to a $10,000 fine. So don't do that.
As for the broken frame, in most states if it has a legal title but the bike was reported totaled by an insurance company, you can rebuild the bike and put in for a 'salvage' title. As long as the repairs pass the DMV's inspection, pay the fees, and fill out the forms, they will issue you a new title and you are good to go.
If the bike was NOT reported totaled by an insurance company (maybe the guy who wrecked it didn't have insurance) then you can repair the frame, rebuild the bike as you see fit, and just follow normal title and registration procedure in your state. Just make sure you repair it correctly, and when you fill out the title paperwork check the box that says the odometer does not reflect the actual mileage.
HOWEVER... do your homework. NEVER take a seller word for it that the title is clean, as it could be stolen, totaled, or have a lien against it. A ridiculously high percentage of used bike parts sold on EBAY are stolen. They busted a shop here in GA last week that was selling frames, titles, and motorcycle parts on EBAY, and they had sold thousands of parts over the last two years, every single one of them stolen. So run the VIN before you buy.
Also ask the seller some questions: If the guy who broke the frame rebuilt the bike around a replacement frame (which would explain why he only has the frame for sale), and the VIN on the title/ broken frame was transferred to the replacement frame, then the title to the broken frame is NO GOOD. But if he rebuilt the bike with a new frame and put in for a new title & VIN, then the title on the broken frame really is good.
However, the easiest thing to do might be to simply put in for a salvage title for the bike you already bought. If you can repair it to pass the DMV inspection, they will issue you a new title for maybe $50, and that would save you the bother of swapping the bike over to a different frame.