Hi,
The best way to deal with perennial herbs like thyme and oregano is to trim back the tops and then make sure the plants are put into as bright, sunny location as possible to reduce stetch. also keeping the plants in a cool location will help reduce the amount of stretch. Warm, low light conditons result in taller, spindly plants. As far as the basil, while you can cut it back also I might suggest just sowing seeds for a new crop every two to three weeks or so. This results in relatively fresh material. Again keeping it in a very high light cool temperature location helps reduce stretch.