Of limited interest, I'm sure, but I spent a bit of time working all this out, and wanted to post it before Scotland go 2 down after 5 minutes tomorrow and render it all moot...
So.
If Scotland lose to Hungary, we're out. No ifs, buts, or maybes.
If we draw then we need at least 2 out of 3 scenarios to happen in order to sneak through:
Spain beat Albania AND Italy beat Croatia
Turkey beat Czechia AND Portugal beat Georgia
Denmark beat Georgia AND England beat Slovenia by 5 or more (I think)
If Scotland win against Hungary then any 2 (or more) of these scenarios gets us through
Spain avoid defeat to Albania (Scotland would finish better than Albania and also better than one of Croatia or Italy, regardless of their result)
Netherlands beat Austria (Scotland would be ahead of both Austria and Poland)
England avoid defeat to Slovenia (Scotland would be ahead of Slovenia and also at least one of Denmark or Serbia).
There's also the possibility that Slovenia hammer England (Scotland could finish better than England on goal difference and also would be ahead of at least one of Denmark or Serbia)
Portugal avoid defeat to Georgia (Scotland would be ahead of Georgia and also ahead of one of Turkey or Czechia)
Even if Georgia did win, we could beat them on GD, but we'd have to thrash Hungary, so not likely.
No draws on match day 3 in group E. Doesn't matter who wins, as long as two teams do.
Or, if there are 1 or 2 draws in group E then it comes down to goal difference, so we would have to hammer Hungary, see above.
And yes, I made a spreadsheet to work all this out... :-)
Sure, here's a link - it's more a table than a spreadsheet to be fair, I just needed some way to lay out the various permutations. There are no calculations being done though.