There is no one-size-fits-all answer here, because the content and focus of your presentation can dramatically impact what conveys the message better.
In all cases, I suggest minimizing the code on screen as much as you can. Presentations are not reading exercises, and a lot of people can't read one thing while listening to another.
Whether to put "option 1" vs "option 2" on the same slide, or on separate slides
If you're comparing things, putting them next to each other makes a lot of sense, instead of blindly relying on people's memory. However, depending on how simple the code is, this may be an irrelevant distinction.
It also helps to keep the content of a slide thematically linked. All snippets on the same slide should yield the same result (or a clearly labeled bad/good comparison), rather than showing different kinds of things all at once.
Whether changes should be made by:
- me deleting words and writing in new ones, or
This seems more fitting for a coding demo, rather than something you do on the slide. Practical demos are a great tool for showing developers their day-to-day interaction with this new thing (e.g. how to go about upgrading the old code), but these demos take time, have an annoying habit of breaking right when everyone's eyes are on you, and become less relevant for trivial things or theoretical discussions.
- switching to the next slide
That is usually how presentations work. You only really switch between slides.
- automated animation effects (like fades or wipes or a pen striking out text)
Animations are distractions. However, they can, when used sparingly increase the joy factor, which can help sweeten the proverbial bitter pill that is a dry and boring topic.
Professionally, I would steer away from animations, barring some very select use cases. But even then, I would heavily favor creating two separate (duplicate) slides with minor differences. This will make more sense for someone reviewing the presentation afterwards, and it allows you to easily toggle between the two if someone has a question about it or if you need to re-explain something.
How much change to allow between consecutive slides: Many transitions with tiny self-explanatory changes, or fewer transitions where you tell the audience roughly what happened
If you change more than [X], then it's not a same slide with differences anymore, it's just a different slide altogether. In order to find [X], we'd first need to consider whether distinguishing between the two is actually productive here, which I don't think it is.
What's more important, though, is that you mark the changes. Change their (foreground) color, highlight them (i.e. change the background color), circle them, change the size, bold them, grey out the code that hasn't changed, ... Whatever makes the most sense to visually mark them without detracting from its readability. The best markup is unintrusive and subtle yet clear.
Whether I should even use the presentation software for the actual code, or perhaps switch to an editor, IDE or diff tool between pre-created files
I refer back to the earlier point about demos. They can be useful, but in the right context. I would reserve demos for cases where you're actually trying to teach a practice, i.e. something you want your attendees to be able to do (not just know) after having seen the presentation.
Choices of color scheme, font size (too small = difficult to read, too big = few lines on the slide, need to memorize), inter-line spacing, margins etc - for maximizing readability.
This depends on the room you're presenting in, screen size, complexity of the text you'll be showing, and even time of day and average age of the attendees can factor into this. There is no singular answer here.
As per most style guides, use a well-contrasted palette, stick to a handful of accent colors (two is usually more than enough), and remain consistent about your palette across the slides.
I would also suggest that you use a different font for the code, preferably mimicking the IDE that is commonly used (for the topic at hand).
Also, as much as most developers love dark mode, don't use dark mode screenshot on a slide with a white or light background. Stick to a similar brightness. Don't forget that what's clear and crisp on a monitor when designing the slides isn't always visible on a projector in a half-lit room.
For any important presentation I've had to do, I actually do a dry run, just to check if the presentation's design works on the screen/room in question (or, if not possible, any setup that simulates the experience).
It's usually only a matter of changing the font size or upping the contrast a bit, but these things are much better tested in the actual room than theorized about.
and the largest ones are still under 20 lines or so.
You seem to imply that 20 is a reasonably upper boundary. For a big room presentation, it isn't.
Don't put too much on a single slide, and most definitely don't start making them into reading exercises. The slides should be summarizing what you say, rather than you explaining what's on the slide.
However, if you're giving a small room presentation, e.g. 4 people around a table, with a large (think >60") monitor nearby or a large projector screen, then you could get away with a 20 line snippet, as long as you slowly walk through it one step at a time, picking apart and individually addressing all of the pieces of the code that are not trivial.
Whether or not it's better to separate the content into single slides is very contextual based on whether the broken up parts make individual sense.