in my Python formating code I finally made it to work with everything in order, now I want to add something extra to this exec and select formatting, which is the insert formatting. When the insert has more than 3 elements it should be formatted into a 3 column format. here is an example on when the insert is correctly formatted:

```sql
insert into some_table (
dtr_operation,  dtr_sec2,        dtr_dates_mov,
dtr_sequential, dtr_concepts,    dtr_status,
dtr_codvalue,   dtr_amoun,       dtr_afectation,
dtr_moneda,     dtr_type_cot,    dtr_cotization,
dtr_amoun_mn,   dtr_amoun_cont,  dtr_overdue,
dtr_chkcts  ,   dtr_benefitiary)
values (
@i_operation,      @w_sec2,        @i_date_proccess,
@w_sequential,     @w_ro_concepts, @w_est_trd,
@w_codvalue,       @w_amoun_prv,   "D",
@i_moneyy,         "C",            @w_cotization,
@w_amoun_national, 0,              'N',
'',                '')
```

The rules for the insert indentation are as follow:
- if necessary, use three columns in both the field area and the data area aligned one space after the longest column name, the nesting levels between the first and second part of an insert are independent.

Add a new method or modify the existing one to include insert/insert into formatting as follow:
1. if an insert has 3 elements or less, leave it as is.
2. if an insert has more than 3 elements, separate them by column.
3. the variables part and the values part are independant and have independant indentation.

Here is my current working code with exec and select already done:

def format_block(block):
    if not block:
        return []

    # Identify maximum length before '=' for alignment
    max_length_before_equals = max(
        (len(line.split('=')[0].strip()) for line in block if '=' in line or '!=' in line),
        default=0,
    )

    formatted_block = []

    for line in block:
        stripped_line = line.strip()
        if '=' in stripped_line or '!=' in stripped_line:
            parts = stripped_line.split('!=') if '!=' in stripped_line else stripped_line.split('=')
            left_part = parts[0].rstrip().ljust(max_length_before_equals + 1)
            right_part = '!= ' + parts[1].strip() if '!=' in stripped_line else '= ' + parts[1].strip()
            # Preserve existing indentation
            indent = line[:line.index(stripped_line)]  # Get the existing leading spaces
            formatted_line = indent + left_part + right_part
            formatted_block.append(formatted_line)
        else:
            formatted_block.append(line)  # Keep the existing line as is

    return formatted_block

def format_sql(sql):
    lines = sql.split('\n')
    formatted_lines = []
    current_block = []
    exec_block = False  # To track if we are in an exec block
    select_block = False  # To track if we are in a select block

    for line in lines:
        stripped_line = line.strip()

        # Detecting exec and select blocks based on current line
        if stripped_line.lower().startswith("exec"):
            if select_block:
                # Format the previous select block if we were processing it
                formatted_lines.extend(format_block(current_block))
                current_block = []
                select_block = False
            exec_block = True
        elif stripped_line.lower().startswith("select"):
            if exec_block:
                # Format the previous exec block if we were processing it
                formatted_lines.extend(format_block(current_block))
                current_block = []
                exec_block = False
            select_block = True
        elif stripped_line.lower().startswith("if"):
            if select_block:
                # Format the previous select block if we were processing it
                formatted_lines.extend(format_block(current_block))
                current_block = []
                select_block = False
            formatted_lines.append(line)  # Add the if statement directly to formatted lines
            continue  # Skip adding the if statement to current_block

        # Add the current line to the relevant block
        current_block.append(line)

        # Handle blank lines by formatting existing blocks
        if not stripped_line:
            if exec_block and current_block:
                formatted_lines.extend(format_block(current_block))
                current_block = []
                exec_block = False
            elif select_block and current_block:
                formatted_lines.extend(format_block(current_block))
                current_block = []
                select_block = False

            if not formatted_lines or formatted_lines[-1].strip() != '':  # Only add if last line isn't blank
                formatted_lines.append('')  # Preserve blank lines

    # Handle the last block if it exists
    if exec_block and current_block:
        formatted_lines.extend(format_block(current_block))
    elif select_block and current_block:
        formatted_lines.extend(format_block(current_block))
    else:
        formatted_lines.extend(current_block)  # Add remaining lines that don't need formatting

    return '\n'.join(formatted_lines)

def format_query(query):
    formatted_query = format_sql(query)
    formatted_query = format_declare_block(formatted_query)
    formatted_query = align_commas(formatted_query)
    return formatted_query