One way to force script execution when a connection changes state is to use the on-up / on-down attributes of the /ppp profiles.
So you could have something like:
/interface pppoe-client
add add-default-route=yes disabled=no interface=ether1 max-mru=1500 max-mtu=1500 mrru=1614 name=pppoe-out1 password=****** \
profile=myprovider service-name=********* use-peer-dns=yes user=*********
/ppp profile
add change-tcp-mss=yes name=myprovider on-up=new-ip
/system script
add dont-require-permissions=no name=new-ip owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
source="..."
I have dynamic WAN IP addresses in one MT router, so I'm using it to get the new address and modify some ipsec policies, firewall rules, etc. needing the WAN ip.
You could use it with /tool fetch to send a HTTP(S) request, etc.