let's say you have exactly twice as many bars as he. So you have 1340 and he has 670
So, as long as you have at least 1340, but fewer than 2009 bars, he has some, and you have at least twice as many.
Your backpack contains 2010 chocolate bars, which you are going to divide between your best friend and yourself. You think you are a nice person, so you will give your best friend more than zero chocolate bars. However, you have been craving chocolate recently, and so you must have at least twice as many chocolate bars as your friend after you finish dividing them. What is the difference between the maximum and minimum number of chocolate bars you can have?
So, as long as you have at least 1340, but fewer than 2009 bars, he has some, and you have at least twice as many.
n &\ge 2(2010-n) \\
\Rightarrow\qquad n &\ge 4020-2n \\
\Rightarrow\qquad 3n &\ge 4020 \\
\Rightarrow\qquad n &\ge 1340.
\end{align*}Therefore, you must keep a minimum of $1340$ chocolate bars. Therefore, the difference between the maximum and minimum number of chocolate bars you can have is $2009 - 1340 = \boxed{669}$.