You are right. You can remove the - BITAND("ID", number) part in this kind of queries.
The construction "ID" + number - BITAND("ID", number) simulates a BITOR expression. Oracle does not support BITOR, so we use this construction. However, in the case of the ID changes from Mendix 3 to 4, the BITOR is not needed because the number is always a 64 bits number where the right 48 bits are always 0, so a simple "ID" + number is enough.
For migration from Mendix 3 to 5, it is necessary to open your project in Modeler 4 and then Modeler 5. However, you can run a Mendix 5 project on a Mendix 3 database. The database will be migrated then directly from 3 to 5. However, in that case the migration SQL script will be even bigger...