I like the "display/download code" feature as it is. The code shows up as simple text in my browser and I can click "save as" to actually save the file. However, in the file save dialog the filename is always "index.pl".
I was thinking that the HTTP "Content-Disposition" header could be used here; I'm sure you guys know what it's about. One, it could specify the filename explicitly (although I'm not sure how the node author would enter it); two, it could have the "attachment" type for the download dialog to popup immediately. I actually like that it doesn't pop up the d/l window right away, that behaviour can be preserved by leaving "inline" as the disposition type.
Anywho, just thought it could be a bit of food for thought. I use Firefox btw.