So yeah. Made it, cleaned it, tested it, http://www.4shared.com/file/wFVnXqNe/Mages_Guild_Spy_Fix.html. Julan approves BTW.
EDIT: This seems to be turning into a larger project of patching holes in quests/dialogue/etc, so I will collect here a working list of proposed fixes and changes:
[List of proposed changes completed and removed - see below]
EDIT AGAIN: Here is the list of things I have done so far.
Changes to Ranis's Telvanni Spy quest:
-Orphaned journal entries about Movis Darys and Tiram Gadar were linked back in with new dialogue lines. A nonsensical misplaced dialogue response from Trebonius was fixed.
-Players who opt to have Ranis expelled can get the usual quest reward from Ajira, and gain a faction disposition increase with House Telvanni instead of the Mages' Guild.
-If Ranis is expelled, Tiram will be sent to take her place. he will appear in Ranis's spot after the player collects the reward from Ajira, with all of Ranis's old services including advancement.
-Changed dialogue and quest-resolution options for players who are Archmage or who become Archmage during quest: an Archmage player can choose to either expel Tiram themselves or keep him around, assigning Ranis the job of undermining House Telvanni by feeding Tiram false info.
-Telvanni players can scold Tiram over his bad credentials. Telvanni players who are also Archmage can fire Tiram from his post, as he is obviously no longer needed, and tell Ranis he was expelled.
Changes to Trebonius's quests:
-Players who kill Trebonius before solving the Mystery of the Dwarves will end the quest when they find out what happened, with a journal entry indicating intent to publish on their own instead of taking their findings to Trebonius.
-The initial journal entry for the "Kill Telvanni Councillors" quest has been edited - apparently Bethesda wrote it twice with slightly different wording. The unused entry's wording was less repetitive so it has been swapped in. The quest will be marked complete when the player becomes Arch-Mage.
-Telvanni players will be able to report Trebonius's orders to kill all the Councillors to the Mouths.
-Trebonius will no longer challenge the player to a duel right away after the player becomes a Wizard. The player now MUST speak with Skink or Edwinna and in order to advance - previously, these two quest options amounted to nothing at all. The "Master Wizard" rank is also no longer skippable.
Working on:
-If the player is co-Archmage when Trebonius gives the "Kill Telvanni Councilors" and is also a member of House Telvanni, s/he may call for a hit on Trebonius to circumvent those orders after reporting to the Mouths.
Does anyone know of any other holes that could be patched?