The data which precedes the OP_DROP will have a length indicator to tell you how much data there is, and this determines when to stop reading the fields. Don't look for the OP_DROP (0x75) because this could equally legitimately be the first character of a custom field name. You can see the script encoding on the bitcoin wiki:
https://en.bitcoin.it/wiki/Script
Hex values 0x01 - 0x4e are relevant for representing data length. But overall you'd probably be better off finding a library for decoding bitcoin transactions into their constituent scripts, then scripts into their constituent data elements, so you don't have to worry about this low-level stuff.
We use an OP_RETURN after the OP_DROP to make it clear that this output contains no spendable assets.