My current character is going to side with the Brotherhood of Steel for endgame, but I am planning on doing as many Railroad quests as I can before I betray them, as well as getting Deacon's affinity to max (so in a way I am acting as an infiltrator). So far I have done Tradecraft, Boston After Dark, PAM's first DIA cache, the Augusta Safehouse quests (Butcher's Bill 1 and 2), Mercer Safehouse, and just last night completed Memory Interrupted. I have Tinker Tom's Weathervane quests to start, and have a quest called Concierge in my log. After completing Memory Interrupted, I returned to the RR HQ to hear Des talk about how the BoS are officially their enemy, but they will delay making an attack on the Prydwen until later.
So, now this makes me wonder: How far should I go with the RR quests before I can safely walk away without causing issues with either of the factions?