The issue with using melamine is that it severely clouds the pool requiring a clarifier to clear it and, even worse, it is partly soluble at pool pH, roughly 20 ppm soluble, so it's always on the edge of looking cloudy and doesn't get completely removed. The CYA test uses a pH buffer to significantly lower the pH which causes the melmaine cyanurate to be effectively insoluble.
I've been thinking of ways where a melamine-like solid polymer with a lot of surface area might be able to capture CYA for physical removal. This would be similar to some products that exist that remove calcium from the water by entering into bags, precipitating/attaching there, and then the bag is removed. This will take a lot of money, research and time (and remember, this isn't my day job).