There's a comprehensive Astral Projection power in GURPS Psionic Powers, p26-30, including the Astral Travel ability, which is what provides the "leave your body behind and travel the planes" ability. It comes in six levels: level one is 28 points, but rather limited, while level six costs a total of 80 points, but is comprehensive.
While this is written up as a psionic power, you can change it to a magical ability simply by changing the Psionic "power modifier" to Magical, which doesn't change the cost. Since it's fully described using the powers-building system, it should also be fairly easy to translate it to RPM magic.
As for "Free spells with a price", there isn't a system for that, but it isn't hard to construct new magic rules for GURPS, which I will now attempt. Let's approximate the CoC system, where magic is fairly easy and potent, but a severe menace to the caster, and anyone else around.
GURPS rather wants there to be a skill to roll against to do things, so let's have an IQ-based Hard skill to do this, with no default. To buy this skill, you need to spend character points, but you can get them by taking on points of Corruption, which is described in GURPS Horror, p146-148. Let's make it one point of Corruption for each character point in the skill. That's pretty friendly: you are unlikely to spend more than about 8 points at first.
Then you actually need to power the spells you cast. Following the structure of the standard spell casting system, spells cost at least one energy point to cast. Big, hard spells might cost 50 or 100 energy points, but most cost less than 10. You get energy points by taking on more Corruption points. The exchange rate is the major adjustment point in this system, but at this stage, let's make it 1:1. You don't get discounts on the cost for having high spell-casting skill, and there is no equivalent of the Magery advantage to improve your skill. Taking up this system was not a good idea for the character. You'll also want Thaumatology for the Diabolic/Horrific Critical Failure table.
So Joe Investigator has found an ancient tome, studied Gothic so he can read it, and learned the skill of spell casting and some spells. You can use spells from the Basic Set or GURPS Magic although you'll have to consider what spells are available: I'd suggest no Healing magic unless it also Corrupts the beneficiary. Joe hasn't spent any character points, and casting spells isn't fatiguing for him. He just has a Corruption total that steadily increases. What does that do?
Well, the details are in Horror, but he has to make regular Will rolls which are penalised if he has a lot of Corruption. If he fails one of these Will rolls, he has to convert some of his Corruption into Disadvantages. If he uses magic regularly, he's in a death spiral towards madness and death. To pull out of this, use the Black Magic rules from Magic, which requires giving up magic. Forever.