In imps a low spade seems automatic, we need 5 tricks so if partner has KJxx of spades he will need a minor suit trick anyways, and if partner has Jxxx of spades we need him to have a club trick and the DA giving declarer AK Kx KJT9x AJxx. A diamond shift loses to the latter holding and doesnt gain ever that I can see.
In MP it is certainly a good problem since declarer could have Ax Kx AJxxx AKxx or similar making the SQ lose a trick. Some things that make me want to play the SQ:
1) With AK of spades declarer might have rebid 2N/opened 2N.
2) There are more hands possible for declarer where the SQ gains a trick than when it costs (club entry AND diamond ace not likely from partner, other layouts where declarer has 10+ tricks if we don't play the spade queen are more likely).
Factors against playing the SQ:
1) Restricted choice (declarer could win either honor at trick 1)
2) With Ax of spades and Kx of hearts declarer might have bid 3S over 3H
3) If declarer is a poor player, they might have ducked trick 1 or considered it (a lot of people don't know to win the ace and try to block the suit).
I guess it depends a lot on the opp, but it seems like a close call. Against myself I would play the SQ.
edited, then realized my edit was wrong so redited. Too late for this
1♦-1♥-3♣-3♥-3nt