I think the following construction works: Given $\alpha \leq \beta$, define sequences $(a_n)_n$ and $(b_n)_n$ as follows: $$a_0 = 0;$$ $$b_0 = 1;$$ $$a_n = (\beta/\alpha)b_{n-1};$$ $$b_n = {1-\alpha \over 1-\beta}a_n.$$ Now define $E_n = [a_n, b_n)$ and $E = \bigcup_{n=0}^\infty E_n$.
The sequences were chosen so that $\bigcup_{i=0}^n E_i$ contains (roughly) $\beta$ of $[0, b_n)$ but only $\alpha$ of $[0, a_{n+1})$. It actually always contains slightly more than this, because it contains all of $[0, 1)$ instead of some crazy fractal pattern inside it, but any finite initial segment doesn't matter to the problem. As $R \rightarrow \infty$, the density of $E \cap [0, R)$ in $[0, R)$ oscillates (linearly!) between the two values, giving the behavior you requested.
But don't take this as gospel. It's been a while since I did any measure theory and I wasn't much good at it even at the time.