# Do this so that innocent blood is not shed
"Do this so that family members do not kill an innocent person"
# in the midst of the land
"in the land" or "in the territory"
# so that no bloodguilt may be on you
The people of Israel being guilty for a person dying because they did not build a city where he would be safe from the "blood avenger" is spoken of as if the guilt of his death is on them.
# may be on you
This means that if a family member kills an innocent person, then all the people of Israel will be guilty for letting that happen.