When a new UDF is added to a sample type, it adds to the bottom of the list and to move it to the position you want it in you have to click the up arrow many times.
Could the UDFs be numbered in the list and then when moving them assign them a number for the correct list position? Or to drag and drop them into the correct position?