Yes and no, there was a lesser blockade starting in 2005, that's correct. Then halfway into 2007 after violence broke out between Hamas and Fatah which resulted in the first of Hamas's civilian executions in Gaza, the current, and more draconian, blockade was instituted.
Which then, you are correct, Hamas responded to the new restrictions by committing another war crime of firing missiles into urban areas.
That's why it's yes and no, the original blockade no, the much stricter one that is in effect today was however a direct result of Hamas's first war crime after being voted into office.
Like quick edit: https://en.m.wikipedia.org/wiki/Battle_of_Gaza_(2007)
This is what caused the blockade that was supposed to be a temporary one to shift to a draconian ongoing one. War crimes.
I never said it was fine, but no Hamas's first war crime in Gaza after taking control was not because of the blockade. They straight up publicly executed their political opponents in the Palestinian Authority. You can't do that and not be labeled terrorists.
But yeah their first war crime in office wasn't even against Israel, it was against fellow Palestinians.