By default, the values of component fields are available via the Dreamweaver mediator as escaped HTML. In this case, you should simply be able to reference the values. I'm not sure whether something different happens when iterating over a Fields collection as you are doing, but in general, if it behaves differently, it's probably a bug.
When you add items to a package yourself, you will either wish to create escaped HTML yourself, or to simply create text and have Tridion take care of the escaping. When you create the package item, you do so using the appropriate method: CreateHTMLItem() if you have already created the markup with the appropriate escape sequences, or CreateStringItem() if you expect the Dreamweaver mediator to convert it to HTML.
Should it be necessary, you can use JavaScript functions in Dreamweaver templating expressions. The trick is to use parentheses to ensure that a package item is evaluated first as a string. Then you will have a JScript string object and can use it'sits methods.
For your example, my first attempt would be something like this:
@@(List${TemplateRepeatIndex}.Fields.title).replace("'","'")@@