I see!
Well, for the first part, it largely comes from various drafts of the Star Wars screenplays. Chiefly of course is the revised fourth draft, with occasional rearrangements based on how I thought scenes should flow or to roughly match the scene order of the final cut. Then, several scene extensions and setpieces come from the third draft, such as the expanded scenes on Yavin IV or the trash compactor scene. Sometimes I deferred to the continuity script on the Star Wars Aficionado blog for things that weren’t chronicled in any available script draft (mainly small bits of dialogue). Then, certain EU resources came in handy too. The novelization by Alan Dean Foster has a lot of overwrought dialogue but also useful things like scene extensions (the training scene in the Falcon’s main hold, for example). Similarly, small extensions from the radio drama by Brian Daley (whose script I have in book form) were also valuable since in many cases they came from direct consultation with Lucasfilm. However, an even greater bit of the script comes from my own ideas. I’m particularly proud of my expanded Battle of Yavin with the various squad leaders interacting and a more concrete attack plan than any version of the screenplay.
I’m slow at work (because of school and career stuff) on an expanded version of The Empire Strikes Back, with many ideas from early in production re-introduced and the existing plot expanded greatly. I think it’ll be even longer than this one ended up. Already I have most of the first episode of the radio drama with the attack on the Rebel convoy acting as the film’s new inciting incident.
To answer the question on software, it’s a plug-in for Google Docs called Screenplay Formatter. Most of it is done automatically, and you just have to fiddle with it a bit to get things where you want them.
Hope it helps. 😃