Insertions and deletions (indels) can affect function, biophysical properties and substrate specificity of enzymes, and they play a central role in evolution. Despite such clear relevance, this class of mutation remains an underexploited tool in protein engineering with no available platforms capable of systematically generating and analyzing libraries of varying sequence composition and length. Here, we present a novel DNA assembly platform (InDeL assembly), based on cycles of endonuclease restriction and ligation, that coupled to a k-mer based sequence analysis framework, enables systematic and efficient navigation of the sequence space across different compositions and lengths. We demonstrate the approach by engineering the well-characterized TEM-1 β-lactamase Ω-loop, involved in substrate specificity, identifying novel extended spectrum β-lactamases in areas of the sequence space not previously explored. InDel assembly provides a route to optimize protein loops or linkers where sequence length and composition are both essential functional parameters.