how to sort a type collection based on a number (like sorting bobs by Y)
Override the Compare method in your type. When you call SortList, it uses the Compare function to order the items based on the results of Compare. There's a tutorial *here*
For Before / After, use the InsertBeforeLink and InsertAfterLink method on the TLink object (see linkedlist.bmx in the module code). Sorry, I haven't got anything more "user-friendly", but that should be a start...