Scenario A: It all boils down to remaining distance available until impact and aircraft performance.
- If you are in a commercial airliner you normally only have the option to abort. Your take-off performance calculation is normally optimized for the minimum power to get off the ground while staying safely within all applicable limits. Saves fuel and engine maintenance in the longterm. So you'll need most of the runway to get off the ground safely. Therefore no way to get airborne early (mass takes time to accelerate) and fly over the intruder.
- If you are in an GA aircraft, things look a bit different at first glance but your chances of stopping before hitting the intruder are way better than gambling that your performance is good enough to fly over the intruder. Why? Lower mass and lower speeds. Normally you don't need the whole runway to get airborne which might lead to your thinking "I can get airborne and fly over him". There is just no reasonable way to make this judgement. So just try to stop, your stopping distance will be way shorter than what you are used to when you land as you are way slower.
In any case: your safest decision is to abort the take-off, slam on the brakes and, if your relative bearing to the intruder aircraft remains steady, it's time to head for the grass. Better a damaged gear than a collision.
Rule of thumb: If the aircraft owner can yell at you why you have damaged his aircraft it has been a good day. It means you are still alive.
Scenario B: Don't move. If the controller and the pilot of the approaching aircraft didn't notice and/or verbalize it on the radio make a radio transmission to give them a heads up. Something like "Bonanza 5545Y is holding position on runway 09." This might alert the approaching traffic as well as the controller.
To bring your example to the extreme and the approaching traffic doesn't go-around and gets uncomfortably close to you and you are under the impression you are in imminent danger get off the runway and, time permitting, make a radio transmission along the lines "Traffic approaching runway 09, runway is blocked, go-around, I say again, runway 09 is blocked, go-around." You can't out-accelerate him so vacate the runway. If you try to get airborne ahead of him there will be two aircraft with inadequate separation in a very dynamic environment. Try to keep it simple for everybody.
While I might get flamed here for non-standard phraseology even the FAA/your-governing-body-of-choice mandates that you should do everything that you deem helpful in this moment to avoid an accident.