Tailoring optical properties and stimulated emission in nanostructured polythiophene