I took a look at implementing an option to dump the stored FrameBuffer data as a NEO file instead of the usual BMP or PNG format. It does work for the 3 ST modes. I don't know if any applications support medium or high resolution NEO, but I think the generated file is a valid _expression_ of the format, at least. It's a fairly small change:
Alternatively, for the question of getting the palette indices in order, the other PR I mentioned earlier does extract the palette in the correct order as part of the indexed PNG: