For 1011, the next step is 1110 - 0111 = 999, and then... apparently you're supposed to handle that as 9990 - 0999, rather than 999 - 999. Huh. I see.
But I'm inclined to consider that a bug in the definition, rather than in the code. :-} The four-digit-ness came from applying the operation to four-digit numbers, and saying "oh yeah and we'll zero-extend the results to four digits" introduces an ugly element of redundancy.
However, we can make it not ugly anymore by making "zero-extend everything to make it be 4 digits" the primary condition. Instead of applying it to 4-digit numbers, we'll make every number have 4 digits and then apply the Kaprekar procedure. So we'll now be working with the numbers 0000-9999, rather than 1000-9999. (There's no way to zero-extend numbers bigger than 9999 to be 4 digits, so that's all.) Here are the results for 0000-9999:
I think the frequencies of the number of steps to equilibrium are somewhat nicer, as well, when you count 0000-0999. As a simple metric, they have more factors of small primes, especially 2.
http://pastebin.com/3iXT777N