A question that has always fascinated me. In my previous readings, the general consensus was that Stalin was stunned by Hitler's betrayal, but did Stalin plan on sticking a knife in Hitler's back before he got beaten to the punch?
As is pretty much always the case with these sorts of questions it's going to be pretty tough to get a solid historical answer. Stalin didn't betray Hitler and, as such, unless someone can turn up a document in which Stalin announces his intention to do so (which, to my knowledge, doesn't exist) then we don't have much to go on.
Of course after the fact the Soviets play up the "betrayed" angle quite well -- it's good for propaganda and it helps to solidify things with the new allies -- but given how tightly the Soviets attempted to control their own historical narrative it's difficult to take much of what they said officially at face value.
So that leaves us with the vagaries of ideology and some back-of-the-envelope political theory.
Stalin's most notable departure from Lenin and Trotsky's particular flavor of Bolshevism was the abandonment of the dream of sparking a global (or at least European) Communist Revolution. Stalin consolidated Soviet policy around the notion of "socialism in one country"
To that end, Stalin's policies most significantly focused upon the strengthening of the Soviet Union on the world stage with the hope that the USSR might become the city on the hill (to borrow the phrase) of communism as the United States had become it for Democracy.
Drawing the Soviet Union into a war with Germany -- despite Hitler's fear of the rising tide of Soviet power -- did not serve the Soviet interest. As such, it would be irrational for Stalin to undertake such a measure if, as Hitler feared and Stalin intended, the Soviet Union would grow stronger and more militarily dominant with respect to the other European powers with each passing year.
TL;DR: Probably not but all it takes is one source to show otherwise; AFAIK that source doesn't exist and it wouldn't make much sense if it did.
You might use the search function for this, as it has been asked before. This is the first response I found but I'm sure it's been asked before that too, just thought it would save time for everybody. http://www.reddit.com/r/AskHistorians/comments/25qe60/was_the_ussr_preparing_to_attack_germany_or_was/
You should get hold of a book called 'The Grand Delusion' by Gorodetsky.
The question is somewhat moot because the Soviet military was not ready to attack anyone in 1941. The Stalinist machine was working very hard to modernise and meet the standard the Germans set in their rapid conquest of Poland, France etc, but there were obvious problems.
In autumn 1940 the Red Army, on paper very powerful, held a large exercise which clearly revealed its weaknesses. While its units were large with many tanks and were highly mechanised (ie, motor- rather than horse-dependent), there was a sore lack of spare parts, experience, technical training and so on. In chasing numbers and production targets, Red Army units simply couldn't deploy or fight or coordinate, and this reality was laid bare.
Other problems were technical. Soviet attempts to produce a modern fighter monoplane were failing, due to rushed production and a lack of time and care in transitioning industry to the latest standards. The MiG-3, upon which great hopes had been placed, was seen largely as a failure by the outbreak of war due to persistent technical problems and being very difficult to fly (in May 1941 three took off to intercept a German reconnaissance plane: all crashed when they entered uncontrolled spins).
Overshadowing all this was the impact of the purges, which saw approximately half the Soviet officer corps punished or demoted, and crucially saw junior officers placed in command of large units. It also affected weapons designers, the aforementioned MiG 3 was designed, or the design taken over, by the brother of a Stalin crony. It's failure was blamed on the Air Force testing institute, whose chief was executed.
What all this meant was Stalin was desperate to buy time to get his military in order, and not be dragged into the war by a hopeless Britain. He perhaps expected to have to confront Hitler at some subsequent time, but being the weaker power his concerns were entirely defensive. Paranoid about the strength of his own grip on power, his focus was on consolidation and there is little evidence he had the ability or plans to attack Germany.