Based on the research, it seems that blood was already present inside organisms before there were mechanisms to pump it around said organisms.
The evolution of blood seems to be a difficult question to fully answer, due to the scarcity of hard evidence.
This study (
Tracing the evolutionary history of blood cells to the unicellular ancestor of animals) gives evidence to support a hypothesis that the evolution of blood occurred in a number of stages as unicellular life developed into more complex multi-cellular life which then developed into chordates and then vertebrates. The process likely started at least 1 billion years ago and took multiple hundreds of millions of years until it was completed.
Much is still speculation though:
"Blood cells are thought to have emerged as phagocytes in the common ancestor of animals followed by the appearance of novel blood cell lineages such as thrombocytes, erythrocytes, and lymphocytes, during evolution. However, this speculation is not based on genetic evidence and it is still possible to argue that phagocytes in different species have different origins.
It also remains to be clarified how the initial blood cells evolved; whether ancient animals have solely developed de novo programs for phagocytes or they have inherited a key program from ancestral unicellular organisms.
...
Overall, this study has provided insight into the origin of blood cells in the animal kingdom, where the primary phagocytes in the ancestor of animals arose by activating the CEBPα-driven phagocytic program inherited from a unicellular organism, and has clarified the molecular mechanism by which the phagocytic program is suppressed to maintain nonphagocytic lineage cells in vertebrate hematopoiesis, that is, polycomb-mediated epigenetic suppression of CEBPα."
Evolution of hearts is much better understood, as there is supporting and direct fossil evidence.
Cliff notes:
The heart has changed and adapted from a single-layered tube with its own contractility supporting an open circulatory system, to a powerful four-chambered muscular pump devoted to loading and unloading a large amount of blood around a closed, valved circuit circulatory system
The primitive blueprint for the circulatory system emerged around 700–600 million years ago. Specific genes have been isolated in certain jellyfish species which have been shown to play a role in myogenesis, leading to the conclusion that these different genes may be the primordial beginnings of the heart and circulatory system that we see in later bilaterian species.
The primitive blueprint for the heart and circulatory system emerged with the arrival of the third mesodermal germ layer in bilaterians. The first heart-like organ appeared over 500 million years ago, most likely in an ancestral bilaterian. This system most likely resembled that of the most primitive urchordates or cephalochordate. The circulatory system of these species did not have a definitive heart, but included a single-layered tube with pulsatile contractility, in support of an open circulatory system.