I've just checked it, and found that what I said above is wrong - the underlying must be in fact selected with asset() before and not after contractUpdate(). This will be added to the manual. Reason is that the option chain is individually stored per asset. So the second version of your script is the right one. When only two assets are in the assets file, it won't crash.