Create a start game enabled quest in the Geck. Name it whatever you want. Then create a quest script and place this inside it:
[collapsed title=Quest Script]
scn addfactionSCPT ;script name = add faction script
Begin Gamemode ;Start a gamemode block.
;Any thing in this block will run in EVERY frame when the game is not in a menu / pipboy screen / dialog.
;Load this section down with [NPCRef] .AddToFaction [Faction to be added to] [rank in faction], like so:
;BuddyRef.AddToFaction AntFaction 1 - Adds BuddyRef to AntFaction at Rank 1.
;Make sure they are all before this section
stopquest yourquestname ;change this to the EditorID of your quest so that it kills the quest when it's done running.
end
[/collapsed]
Note that I came up with all that on the fly. Scripting is only difficult if you try starting with difficult scripts. Instead of using "Scripting for beginners" use this page.