I have a text like this:
    LDX LEVEL
    LDA INITD015,X       ; INITIAL ACTIVE SPRITES
    STA $D015
    STA SAVED015
    LDA INITXPOS,X      ; INITIAL HERO X COORDINATE
    STA XPOS
    LDA INITYPOS,X               ; INITIAL HERO Y COORDINATE
    STA YPOS
    LDA INITXPOSMUM,X            ; INITIAL MUMMY X COORDINATE
    STA XPOSMUM
    LDA LEVEL
    BNE NOTLOADENDELEMENTS
    LDA FLAGLOSELIFE
    BNE NOTLOADENDELEMENTS
;    LDX #<BIGELEMENTSFILE  ; LOW BYTE
;    LDY #>BIGELEMENTSFILE ; HI BYTE
;    JSR LOADFILE_EXOMIZER
where i need to align text starting at ";" that IS NOT first char of a line, to end of line, at char number 41 of the line. Lines starting with ";" must be untouched until (and if) the second ";" is ecountred, then staring from second ";" to end of line should be aligned at char 41. Maybe the second ";" is before or after char 41.
Can be this achieved using SED or AWK?