As further follow-up, would he have had any shot whatsoever of a statewide campaign or was San Fransisco the only place he would have been a viable candidate?
Maybe?
But let's begin with your assumption about Milk being a viable candidate in the future in San Francisco city wide elections, because surprisingly given how much of an icon Milk has become, at the time it was actually a pretty shaky one.
Milk moved to San Francisco in 1972 and immediately ran for the Board of Supervisors a few months later in 1973; among other things, this genuinely annoyed other gays in San Francisco politics as Milk was viewed as a carpetbagger who hadn't, as one put it, 'spent the effort setting up the chairs in the hall.' While he polled reasonably well in the Castro, up until 1976 elections to the Board were on an alternating top-5/6 basis citywide, and Milk failed.
His next attempt was in 1976 when the incoming Mayor, George Moscone, resigned his State Senate seat. Through some complicated political manuevering that temporarily brokered peace between the two significant Democratic factions in San Francisco (Leo McCarthy-John Foran and Willie Brown-Phil/John Burton-George Moscone), McCarthy had agreed not to run a candidate against Moscone for Mayor - who had won by less than 5,000 votes against conservative gadfly John Barbagelata - and in return Moscone neither opposed his State Senate seat going to then-Assemblyman Foran and endorsed McCarthy's chief of staff Art Agnos for the now open Assembly seat.
Not wanting to wait, Milk pounced, alienating now not just other gays but also almost the entire Democratic establishment given the deal that had been set up. Milk put up a surprisingly good showing given how little money he raised, but in the process had more or less became persona non grata to every significant politician in San Francisco (with the notable exception of the irascible conservative curmudgeon Quentin Kopp, who endorsed him in that race largely because Agnos had done something minor to annoy him.)
The feeling was mutual; Shilts quotes Milk a year later:
“I’m going to get Foster, Stokes, the whole Toklas [the largest gay Democratic club] crowd, the Burtons, Moscone, McCarthy, Willie Brown, Agnos,” Milk told Mike Wong. “[A]ll of them, I’m going to get even.”
Then in 1977, Milk ran for the Board of Supervisors again. This time, though, with the shift to district elections, Milk had a ready made one that heavily weighted the evolving - previously, it was called Eureka Valley and heavily Irish - and now gay Castro district. While he won by double digits over his closest competitor, Terry Hallinan (a political scion and later long term District Attorney), his share of the vote only reached about 30%. His top three opponents - Hallinan, Bob St. Clair (a former 49ers star and later decades long mayor of a suburb), and Rick Stokes (the selection of the gay establishment) actually combined for more than Milk's total, and it was probably fortunate for Milk that San Francisco elections did not provide for runoffs.
It's worth noting at this point that San Francisco has often punched well above its weight in statewide and national representation, which is generally believed by political scientists to stem from the vicious internecine fights required to gain office in that city; if you can win initial office there, you can probably succeed anywhere. To the caliber of Milk's enemy list, Leo McCarthy was probably the single most powerful politician in California at that point as Speaker of the Assembly, Willie Brown succeeded him in that office and political power in a coup in 1980, held the office for 15 years, and even when ousted still finished off as Mayor of San Francisco, Phil Burton had just lost an election to Jim Wright as majority leader of the House of Representatives by a single vote and had he lived probably would have succeeded him as Speaker, Art Agnos was elected Mayor of San Francisco, and last but not least was Milk's open disdain for Dianne Feinstein, who he opposed even in a proforma unanimous vote as President of the newly elected Board of Supervisors.
Milk's year long tenure on the Board wasn't particularly productive; the sole piece of legislation that he successfully carried was an ordinance on owners picking up after their dogs. One thing Milk completely misrepresents was the anti-discrimination ordinance; it was actually introduced by Supervisor Robert Gonzales a year earlier, defeated by the previous Board, and then reintroduced by him given the new district membership. While Milk and Carol Ruth Silver signed on as cosponsors, Milk had little to do with its passage. Nor did Milk do much on the biggest crisis facing California over the next decade as Proposition 13 devastated local governments starting that summer; he initially voted for a tax hike, then changed his mind, and did and said nothing further on an issue that has now bedeviled two generations of politicians.
But what Milk was good at was publicity; indeed, when the dog poop ordinance passed, he immediately posed for a planned photo of him 'accidentally' stepping in some conveniently placed by an aide that appeared in every paper in San Francisco.
Where this really paid off for raising Milk's stature was when Orange County State Senator John Briggs sponsored an initiative, Proposition 6, which would have allowed local school boards to dismiss any teachers that were gay or lesbian. Milk debated Briggs (who insisted to his death in 2020 that Milk and he actually got along quite well) in multiple TV appearances, and that was what raised his profile both statewide and nationwide. Did Milk express any interest in higher statewide office after that? Not that I've found, but I don't think there's any doubt the man was ambitious enough to consider it - except that he now had 4 years to decide as the next races for state office wouldn't take place until 1982.
Keep in mind, though, that various other politicians of all political affiliations - including, believe it or not, even Ronald Reagan - opposed the Briggs Initiative, and it failed 58-42. While this was a far better result than the 61% in favor of the initiative in early polling, it still did not bode well for the future of an openly gay politician for future statewide office in the 1980s, and indeed many of the 'first openly LBGTQ' state office holders in California have only occurred over the last decade. There were also potential political liabilities for him involving his penchant for younger lovers; it was generally unknown outside the gay community until after his death, but Milk had already begun several relationships with then-17 year olds when far older than them. While it didn't come out during Briggs, given the sheer size of the press in California during the next couple of decades that could investigate candidates, it's unlikely that would have remained quiet.
As far as San Francisco? I did not bring up Milk's enemy list or lack of substantial legislative achievements to denigrate him particularly, but merely to point out the man had made a lot of very powerful political enemies in that city in his short time in the political arena. Another very powerful California politician, Jesse Unruh, provided an appropriate phase for what Milk would have faced: "Money is the mother's milk of politics." While perhaps Milk would have had enough of a national profile after Briggs to raise enough money for future citywide office, it wouldn't have come from anyone local who would have created some extremely powerful enemies had they did so. That said, the one race that would have been fascinating to watch had Milk still been alive would have been the 1987 mayoral race - where he could have potentially gotten a rematch against one Art Agnos.
Sources: The Mayor of Castro Street (Shilts, 1982), Cult City (Flynn, 2011, n.b. almost a conspiracy-level analysis trying to link Milk, Jim Jones and communism but has useful verifiable footnotes and interviews), Double Play (Weiss, 1984 - despite its title and subject, probably the best of the books detailing the internal politics of San Francisco at the time), Tax Revolt (Sears and Citrin, 1985)