Melt the butter in a 10-inch nonstick skillet over medium-high heat. Add the shallot, thyme, and garlic and cook until softened, about 1 minute. Stir in the peas and sugar. Cover and cook until the peas are heated through, about 3 minutes. Season with salt and pepper to taste.