EDIT : I found this userscript that fits your description pretty well. It shows a small "Select" link at the corner of code block that can be used to select its contents.
Here you go. Looks kind of ugly (I just stick a button after the pre element), but I'll leave the CSSing to you:
// ==UserScript==
// @name Copyall
// @namespace http://example.com
// @include http://stackoverflow.com/*
// @include http://serverfault.com/*
// @include http://superuser.com/*
// @include http://meta.stackoverflow.com/*
// @include http://meta.serverfault.com/*
// @include http://meta.superuser.com/*
// @include https://stackapps.com/*
// @include http://*.stackexchange.com/*
// @include http://askubuntu.com/*
// @include http://meta.askubuntu.com/*
// @include http://answers.onstartups.com/*
// @include http://meta.answers.onstartups.com/*
// @include http://mathoverflow.net/*
// @include http://area51.stackexchange.com/proposals/*
// ==/UserScript==
$('pre:has(code)').each(function(){
//using the XBrowser function from http://stackoverflow.com/questions/985272/
function selectText(element) {
var doc = document
, text = element
, range, selection
;
if (doc.body.createTextRange) { //ms
range = doc.body.createTextRange();
range.moveToElementText(text);
range.select();
} else if (window.getSelection) { //all others
selection = window.getSelection();
range = doc.createRange();
range.selectNodeContents(text);
selection.removeAllRanges();
selection.addRange(range);
}
}
var input = $("<input type='button' value='Select all'/>"),
that = this;
input.click(function(){
selectText($('code',that)[0]);
});
$(this).after(input);
});
select all:) From there it is trivial to copy, or manipulate with text services.