The script command you'll want to use is:
Player.SetFactionRank FactionID, 0
This will put the Player in your new faction at the lowest rank. I'm not entirely sure where that would fit into a quest script, but I would guess that it would be something along the lines of:
If GetStageDone QuestID StageIndex == 1 && Player.GetInFaction FactionID == 0 Player.SetFactionRank FactionID, 0 ;Use this line to advance the quest to the next stage indexEndif
Again, that's just a guess. I don't have much experience with Quest scripts.