In this paper, an innovative technique was tested to solve the path-planning problem of swarm nanorobots’ navigation within the human environment. Blood elements were treated as obstacles to nanorobot movement. Blood flow was also factored into the movement problem, as was the environment’s physical properties, including blood viscosity and density, both of which can potentially affect nanorobot behavior. To account for all these considerations in a human body environment, two algorithms were combined, yielding a single algorithm responsible for the self-organized control of nanorobots to avoid obstacles during their movement trajectory. The technique is based on modification of the Particle Swarm Optimization algorithm, referred to as the MPSO algorithm which is classified as a swarm intelligence algorithm, and modification of the Obstacle Avoidance Algorithm, referred to as the MOA algorithm. The proposed MPSO algorithm generated the best locations in a given operational area enabling nanorobots to detect the target areas. The proposed MOA algorithm allowed nanorobots to efficiently avoid collision with blood elements. The simulation results show that the combined MPSO-MOA algorithm safely routes all nanorobots past blood elements while navigating within the human body.