Stanley returned to Canada in 1936 and was appointed a professor of history at Mount Allison University in New Brunswick. He joined the military upon arriving there and qualified as a lieutenant in the New Brunswick Rangers. He served as an infantry training officer in Fredericton and then proceeded overseas during World War II as historian (rising to Deputy-Director) in the Historical Section at Canadian Army Headquarters in London, England; he was also responsible for administering the War Artist Program, whose staff included Bruno Bobak, Molly Lamb Bobak, Alex Colville, Charles Comfort, Lawren P. Harris and Will Ogilvie. Stanley was discharged as a Lieutenant-Colonel in 1947. He then taught at the University of British Columbia, holding the first chair in Canadian history in Canada. He came out of military retirement in 1948 to help fight floods in the Fraser Valley and was on the Reserve of Officers until 1967. He was awarded a Guggenheim Fellowship (1949) to do research into the history of Canadian government policy in dealing with Aboriginal people.