Just use `if (isset($column_data['after']) && array_search($column_data['after'], array_keys($columns)) === false)` in first place?
Also with three `=` so it works correctly when inserting a column after the first one