Updated Insert Tab Operation to handle hard or soft tabs