You need to get out of the way any time you are holding up traffic behind you. On a two-lane, I pull over whenever I have more than two vehicles behind me waiting to pass and I can do so safely. And when a vehicle pulls out to pass me on a two-lane road, I slow down and move to the right to minimize the passing time and potential for contact. I slow down even more when the vehicle passing me looks like he might have cut it tight and could come back into the right lane before has completely passed. However, I am careful not to invite the vehicle behind that one to pass unless I am comfortable that it can do so safely.
If a vehicle passing you starts to move right while still next to you, it's no time to get territorial. Brake hard (unless another vehicle is breathing down your sissybar) and move right. Ride on the shoulder if there is one. Get indignant later; get out of the way now. You have a nice narrow cross-section, so take advantage of it.
Being narrow can also serve you if you find yourself in that most horrifying of situations-passing a car on a two-lane when another one appears up close going the opposite direction. Crowd right up against the car you are passing and hope that it and the other car move over enough that you don't clip the on-comer. It is less dangerous to stuff yourself against the car you were passing than to barely nick the one with a 120-mph speed differential. The good news is that, on most two-lane roads, there is enough space to do this. I have seen it done on several occasions on U.S. roads. In some parts of the world, riders do it routinely and other drivers just move over and let them through.
Passing errors that would be mild fender-benders if two cars are involved can be fatal when one of the vehicles is a motorcycle. But if you help other drivers see you and minimize their chances to connect by staying alert and using your bike's size and acceleration, you might make all your passes uneventful.