A while back, I posted some TextWrangler scripts that allow for commenting and uncommenting blocks of code for codeless language modules such as Stata, R and LaTeX. The problem with my scripting approach was that it required two different scripts—one for commenting, one for uncommenting.
Steven Samuels has generously corrected this problem by writing one script that handles both functions — based on whether the line is already commented, running the script will either remove the existing comment or comment out the (currently uncommented) selection.
Download the new and improved script here. Visit this page for information on how to assign a keyboard shortcut to the script.
Note: The old script is still available. The only reason I can think of to use the old version is in case you want to apply multiple comments to the same line (for example, if you use a comment to create a heading in your code, then you comment out the entire section).
Many thanks to Steve for supplying the script!