First, I built script using a similar option menu by myself, but it always crashed OmniFocus. Then I tried the Filtered Menu example and noticed it crashes both OF3 and OF4 (both iPad) as well.
It seems it is not possible to dynamically remove fields from a Form.Field.Option. I reported this awhile ago, but nothing happened, yet.
In my opinion, this is the holy grail in writing scripts that deal with existing lists of data (e.g. assign a target project without wanting to type the whole title).
The issue must be either a regression, because the example probably has worked before or something in my OF database leads to the issue.
I’ve used similar forms a couple of times in various plug-ins (and if I recall correctly, I started with a script from Sal so possibly that one, or at least similar)
As I’ve used them in a few different plug-ins, I recently started a library that I can call to save me maintaining similar code across plug-ins - it’s a work in progress (not even a README yet) but it might be of some use to you:
So far working okay in the latest OF4 but I haven’t tested it on iPad/iOS, only macOS.