Unfortunately not because this button cannot be accessed by the API:

This is enabled by default, and when that is the case the API doesn’t see any samples in slots beyond the first one. Once it is disabled then the samples slots can be accessed and loop points set.
What we really need are proper sample aliases and then this tool could be made a whole lot more elegant. For now its a minor annoyance but worth it for all those exotic tunings 
Maybe this tool can help, it takes different approach so might work better for this kind of thing: