If you only care about this logic being applied in the UI, then I would probably go with validateLine. The scenario sounds like a better fit for a user event script rather than a client script though to make sure it works on JEs that are not created manually in the UI (e.g., CSV Import).