**C# (101 characters)**

    string I(string i){int s=0,j=0,f;for(;j<12;)s+=(i[j]-48)*(++j%2>0?3:1);f=10-s%10;return i+(f>9?0:f);}

With linebreaks/whitespace for readability:

    string I(string i) 
            { 
                int s = 0, j = 0, f;
                for (; j < 12; )
                    s += (i[j] - 48) * (++j % 2 > 0 ? 3 : 1); 
                f = 10 - s % 10;
                return i + (f > 9 ? 0 : f); 
            }

Tested on several ISBNs from books on my shelf, so I know it's working!