Yes, stance change does activate when you use a attacking Z-Move, however, Aegislash won't turn back into Shield Form when it uses a status Z-Move
Source: https://www.youtube.com/watch?v=xWUQUcLKtpE at 8:55
Yes stance change does activate if you use z-king’s shield. battle replay
Note: I did play hackmons due to the fact that I couldn’t figure out where else to use aegislash.