Thank you for sharing your workaround. It is interesting to see different solutions to common problems.
Are you using these scripts in an automation script, scripting extension, or both? If you are using this in scripting automation, does the checkbox trigger some other automation, or is the filtered view used in a later action within the same automation?
Although it isn't possible to filter records in the selectRecordsAsync() query, it is possible to filter the returned records from the query result using JavaScript. Can you explain why you choose to use a view instead of filtering records in JavaScript?
It looks like your system takes an array of record IDs as an input. Is there a reason why you do not specify those record IDs in your selectRecordsAsync() call? If you have less than 100 record IDs, you can get all the records in one call. If you have more than 100 record IDs, you can get them in batches of 100. (Although if I expect anything close to 100, I tend to just query the entire table and then filter down to the records I want, unless I am worried about other limitations.)
How do you make sure that different scripts running at the same time do not have conflicts in setting/clearing the checkbox field? Do you use a different checkbox field for each automation?
I notice that your script does not clear any checkboxes that may be already selected. Is this why you recommend filtering the records from the view again?
How fast does this system run compared to other methods? I would expect that filtering in JavaScript would be faster than updating records and then querying a view.
My gut feeling is that this system is more complex than I would want to maintain, but since you designed the system, maybe that is not an issue for you.