Make each substation its own script. Then run a python script to run python scripts. This is the example code for one 'large' substation.
Substation Information
psspy.stationdata(10000,[f,f,f],r"""SUB""")
345 kV Nodes 10000 Bus
psspy.stationnodedata(10000,101,[10000,i],s)
psspy.stationnodedata(10000,102,[10000,i],s)
psspy.stationnodedata(10000,111,[10000,i],s)
psspy.stationnodedata(10000,112,[10000,i],s)
psspy.stationnodedata(10000,113,[10000,i],s)
psspy.stationnodedata(10000,114,[10000,i],s)
psspy.stationnodedata(10000,115,[10000,i],s)
psspy.stationnodedata(10000,116,[10000,i],s)
230 kV Nodes 10001 Bus
psspy.stationnodedata(10000,201,[10001,i],s)
psspy.stationnodedata(10000,202,[10001,i],s)
psspy.stationnodedata(10000,211,[10001,i],s)
psspy.stationnodedata(10000,212,[10001,i],s)
psspy.stationnodedata(10000,213,[10001,i],s)
psspy.stationnodedata(10000,214,[10001,i],s)
psspy.stationnodedata(10000,215,[10001,i],s)
psspy.stationnodedata(10000,216,[10001,i],s)
psspy.stationnodedata(10000,217,[10001,i],s)
psspy.stationnodedata(10000,218,[10001,i],s)
345 kV Switching Devices
psspy.stationswddata(10000,101,111,r"""1""",[i,i,2],[f,f,f,f],r"""192""")
psspy.stationswddata(10000,101,113,r"""1""",[i,i,2],[f,f,f,f],r"""496""")
psspy.stationswddata(10000,101,115,r"""1""",[i,i,2],[f,f,f,f],r"""792""")
psspy.stationswddata(10000,111,112,r"""1""",[i,i,2],[f,f,f,f],r"""296""")
psspy.stationswddata(10000,113,114,r"""1""",[i,i,2],[f,f,f,f],r"""596""")
psspy.stationswddata(10000,115,116,r"""1""",[i,i,2],[f,f,f,f],r"""896""")
psspy.stationswddata(10000,112,102,r"""1""",[i,i,2],[f,f,f,f],r"""392""")
psspy.stationswddata(10000,114,102,r"""1""",[i,i,2],[f,f,f,f],r"""692""")
psspy.stationswddata(10000,116,102,r"""1""",[i,i,2],[f,f,f,f],r"""992""")
230 kV Switching Devices
psspy.stationswddata(10000,201,211,r"""1""",[i,i,2],[f,f,f,f],r"""182""")
psspy.stationswddata(10000,201,213,r"""1""",[i,i,2],[f,f,f,f],r"""486""")
psspy.stationswddata(10000,201,215,r"""1""",[i,i,2],[f,f,f,f],r"""782""")
psspy.stationswddata(10000,201,217,r"""1""",[i,i,2],[f,f,f,f],r"""1082""")
psspy.stationswddata(10000,211,212,r"""1""",[i,i,2],[f,f,f,f],r"""286""")
psspy.stationswddata(10000,213,214,r"""1""",[i,i,2],[f,f,f,f],r"""586""")
psspy.stationswddata(10000,215,216,r"""1""",[i,i,2],[f,f,f ... (more)