Just taking a quick look at the files (don't have the ability to actually test it myself at the moment); under your mod folder, GameInfo/PlanetWormhole.entity, and each of the STAR_<Color>.entity files have a section for abilities.
I would take the Gravity Warhead ability, copy that and rename it to something like "AbilitySolarPhaseDestabilization", and open the new ability file up in notepad. From there I would make buffType set to "BuffSolarPhaseDestabilizationSpawn" (I'll get to that in a second), change the value for "numOwnerships" to 2, add the line "ownership "Friendly"" below that, set the range to around 30000 (random guess at gravity well radius, you might want to change that later to suit your needs), set speed to 30000, make HasWeaponEffects set to False, remove the lines between "HasWeaponEffects" and "NeedsToFaceTarget", set "aiusetime" and "aiusetargetcondition" to "Invalid", set the two lines below them to False, set "ignoreNonCombatShipsForAutoCastTarget" to false, make "isPassive" True, remove the for lines below that, set the cooldown times to 5s.
From there I would make copies of BuffGravityWarheadSpawn.entity and BuffGravityWarheadAction.entity and rename those to BuffSolarPhaseDestabilizationSpawn.entity and BuffSolarPhaseDestabilizationAction.entity repsecitvely. In BuffSolarPhaseDestabilizationSpawn I would change buffType there to "BuffSolarPhaseDestabilizationAction", change "numOwnerships" to 2 again, add the line "ownership "Friendly"" below it, again, and set the range to 0. I might remove the stuff in the quotation marks for smallEffectName, largeEffectName, and SoundID, but the last time I messed with that, I'm pretty sure I made the game unstable... Anyway, in BuffSolarPhaseDestabilizationAction.entity, I would set numEntityModifiers to 0, remove both "entityModifier" lines and the 5 lines below each, and possibly remove the stuff in quotations for smallEffectName and largeEffectName, but like I stated earlier, I think it made the game unstable.
From there I would open up the .entity files for each star color and PlanetWormhole and in one of the Ability<number> lines for each file add in "AbilitySolarPhaseDestabilization"
That should make it so all ships that phase jump to a wormhole or star get their phase drives disabled and make them unable to phase jump back out, which I am assuming is what you wanted. Hope I didn't miss anything there... 
There might be a better method of doing that, as the method I described would probably cause a fair bit fps issues on larger maps, but it's what I can think up right now. Also, my first post! :3
*Edited a few mistakes in there