With one of my characters, I was also unable to buy Hjerim even though I already finished the Blood on the Ice quest. The steward was not giving the conversation options for inquiring about or buying the house. I tried the console command: setstage 000A7B33 10 as suggested by the UESP wiki Blood on the Ice article, and it allowed the steward to sell me the house.
If you can't start the Blood on the Ice quest, here are info that may help:
Although most of the NPCs needed for the quest to initiate are marked as essential, another quest, namely the Dark Brotherhood quest Mourning Never Comes, will encourage you to kill Nilsine Shatter-Shield. Even though she is not related to this quest, her mother, Tova Shatter-Shield, will commit suicide if Nilsine is killed, and will therefore render this quest impossible to initiate.
Source: UESP wiki's "Blood on the Ice - Bugs" article
A possible fix, from the UESP wiki's "Blood on the Ice - Notes" article:
If you've killed Nilsine in order to get a bonus reward in the quest Mourning Never Comes, Tova will be dead inside her house, and you will need to pick the lock of her house in order to get the key to Hjerim. This will only happen if you met the requirements for Blood on the Ice and then completed Mourning Never Comes.
See the requirements, notes and bugs list at the UESP wiki's Blood on the Ice article, to see how to start the quest and avoid the bugs. Also, if you are playing on the PC, install the Unofficial Skyrim Patch to fix a lot of bugs related to Blood on the Ice quest - one of which is related to the key to Hjerim:
If Tova Shatter-Shield is dead (actually just disabled, but that's another story) because you completed "Mourning Never Comes" (DB03) before MS11, a substitute key for Hjerim will be made available by the USKP.
If you haven't met the requirements (you can always check whether or not you have met the requirements for the quest to start, as the lock to Hjerim will change from a “key required”-lock to a normal lock when the quest becomes available) to start Blood on the Ice before completing Mourning Never Comes (before you killed Nilsine), you will have to to load an earlier save before you killed Nilsine. Not meeting the Blood on the Ice quest requirements before completing Mourning Never Comes, will make Blood on the Ice impossible to initiate.
Some posts at the discussion page at the UESP Wiki's Blood on the Ice article state that killing Nilsine is not an issue:
Ok so I noticed the glitch mentioned about killing Nilsine for the DB causing Tova to die and therefore not be able to give you the key to Hjerim. I have done DB quest first including killing Nilsine several times and have NEVER had this break the quest. As long as you haven't entered Clan Shatter-shield's house since the DB quest you will find Tova's corpse and suicide note complete with the Hjerim key. I have tested this several times but only on 360 so can't confirm for PS3 or PC.
I'm a PS3 player and I had yet to initiate BOTI before I started the DB quest. Unknowingly, I killed Nilsine. However, I was still able to initiate and complete the quest perfectly. I didn't know you could get the Hjerim key off Tova's dead body, so I just picked the Hjerim lock. Everything worked fine. I don't think the Tova glitch affects everyone.