Here's an example of some concepts. I'm just attaching the files instead of trying to paste them. The RTE is buggy and likes to explode if I paste long things and then dare to scroll.
This shows one way to reduce the Lab image to a set of binned pixel lists. This also shows a way to make the slider snap to the bin center values. Note the use of nested functions to avoid dragging around a pile of globals. The gamut image and color point scatter creation are handled in a function so that the slider CBF can update them as needed.
Is there a particular reason why you're displaying the gamut slice using scatter() and square markers? I attached an alternative version that uses image() instead of scatter(). It's faster, even with 512 points instead of 65.
Still, the largest amount of time was being spent on the binning process, so the above example should help a lot in that regard.
Using logical masking to set the values of OOG points saves a lot of time as well.
Note that for a small number of L bins, the image points tend to appear OOG, even though they really aren't. The reason why should be pretty obvious geometrically. The attached code is fast enough that you can use a larger number of bins (e.g. 101) without much penalty.
The attached files are provided as demo scripts. In practice, all you'd have to do is remove the first couple lines and save the file. At that point, it'll be a proper function that can be called as needed. You can then flesh out the rest of the synopsis to suit your needs.
Also, I have no idea why the spam catcher flags some things...