Thanks a lot for the update!
But I noticed (correct me if I'm wrong about that) that you didn't take into account that Djoko and Rafa will be playing Rotterdam coming February (if they actually turn up over there, of course...), where both of them can gain a lot of points as it'will be their first appearance over there. That might well mean that both of them may get a lot closer to Roger's ranking points even before Dubai starts off.
I did take it into account, but I now see that they way I wrote it was misguiding. I wrote that Nadal could gain 475 points at "those two tournaments" meaning Rotterdam/Dubai, but it was written in a context where it could easily have been misinterpreted to mean Indian Wells/Miami. I've changed it now, so that the meaning is clear.
For the record, a win at Rotterdam would leave Nadal trailing Roger by only 400 points. If he also wins Dubai he would gain a further 300 points. BUT he would lose the 55 pionts won at Queens due to having too many optionals. Roger would then have to reach the final of Dubai, whereby he would still lead Nadal by a measly 65 points. So there it is:
If Nadal wins both Rotterdam and Dubai, and Roger doesn't reach the Dubai final, he'll lose the #1 ranking. Doesn't seem very likely, though.
If Nadal wins Rotterdam (gains 250 points) and makes the Dubai final (gains 210-75 = 135 points) he'll gain a total of 250 + 135 - 55 = 330 points and be at a career high 6310 points. Roger, however, is at 6330 points, even when his Dubai points come off.
So there you have it: Nadal will have to win BOTH Rotterdam and Dubai while Roger fails to reach the finals of Dubai. That's the only way that Federer loses the #1 ranking before Indian Wells/Miami.