My first reaction was "Vote up posts with code and vote down those without", as in including a comment of "+1/[-1] for [not] including source", but for those questions where its the askers first question or the asker never returns or doesn't respond, there isn't much 'encouragement' - and maybe for those there never will be.
I see this in two parts,
- is up/down voting enough encouragement/discouragement to include code
- If the answer to #1 is 'no', do we need a structural change like @skinnyTOD linked,