"However, events in Europe-—particularly the German annexation of Austria in March 1938 and Czechoslovakia in the following year, as well as a nonaggression pact signed with the Soviet Union in August 1939-—were omens of war, and the Kabul government decided it did not want closer ties with the Nazi regime in Berlin. At the declaration of war, Zahir Shah immediately proclaimed Afghanistan's neutrality; the amir was determined to keep his country out of the conflict. Germany, conscious of Afghanistan's strategic location, considered supporting a pro-Amanullah coup to establish a sympathetic government in Kabul. German officials and Afghan supporters of the former king were sent to Moscow to test Russian reaction to the idea, but they received a noncommittal response and the project was shelved.
"Following the German invasion of the Soviet Union in June 1941, Russia and Britain were allied again and adopted a common stance with regard to the situation in Afghanistan. In separate moves, the two governments demanded the evacuation of all Axis nationals in October 1941, a move that Afghanistan resented as an infringement of its sovereignty but still complied with, and all Axis nationals left for India under the promise of free passage to a neutral country. Although Axis diplomats were allowed to remain, their attempts to foment a rising against Britain among the Pashtun tribes on the Indian side of the border were unsuccessful. *Despite sympathy for the Germans because of their traditional enmity with Britain, armed cooperation with Germany was never a realistic proposition for Kabul.* [my emphasis--DT] *Conflict in Afghanistan: A Historical Encyclopedia,* articele "Afghan-German relations"
https://books.google.com/books?id=bv4hzxpo424C&pg=PA7
I would modify the emphasized statement in one respect: I could see Afghanistan geting involved in 1940-1 *if* the USSR approved *and* if it were absolutely clear that Britain was about to be defeated. Short of that, it is just way too risky. (And after June 22, 1941, forget it: fighting both the British and the Soviets at once would be crazy--again unless it was clear the Allies were on the verge of collapse.)
What about Amanullah? He was unpopular, and would be even more so if the godless Bolsheviks were seen as the force restoring him to power in 1940-1--even assuming the Soviets wanted to and were capable of doing so. In the unlikely event he were restored in that way, he would have his hands full quelling rebellions in his own country, and would not be able to attack British India effectively.