I want to add the public IP accessed by the client to the IP white list when I successfully link l2tp
In this case, ROS only opens port mapping to whitelist IP addresses

I find this ,very good
http://forum.mikrotik.com/t/vpn-attacks-blocking/121269/8
Scripts are not needed, create a PPP profile including an address-list= property. Client addresses will be added to the list when the session is established, and also removed when the session terminates.
just to be more clear
The script that @liveup found will cake the ip-add which is hitting the router (public). PPP profile address-list will cake the remote ip-address.