So there's two ways to make changes, using the Reset() function or setting a CC# that will send Bank/Program Change/Channel messages.
The following scripts use Reset() but have also when you comment/uncomment certain lines in the code, you can trigger by a CC# that you specifiy.
CC#121 would be a good candidate for this.
Here's an example of the script in use.
MacBook Pro 10.8.5 2.2 GHz Intel Core 2 Duo 6GB Ram - Logic Pro X (10.2)
MacMini 10.13.6 2GHz Intel Core i7 16GB Ram - GarageBand 10.4.5 Logic Pro X (10.4.8)
iPad Mini iOS 12 - iOS GarageBand 2.0.1
Qosimo X70-A 10.13.6 Intel® Core™ i7-4700MQ Processor 32GB DDR3L 1600MHz memory, 2-500GB 7200rpm hard drives - Logic Pro X (10.4.8)
MacMini M1 11.6 Apple M1 16GB Ram 1TB SSD Logic Pro X (10.6.2) Rosetta 2 not installed