In another app I wrote, this can cause problems if the user selects a ton of tracks, like 1000.  In that case, SQL complains that the argument list (X,Y,Z,...) is too long.  Can that happen here?  If so it might be enough to use recursion to call removeTracks on chunks of 255 tracks or whatever the limit is.