Load a Module versus JavaScript embedded in Theme
You can do pretty much anything you want with custom code, including this.
The question is should you use custom code or an existing module that provides the functionality you're after.

The answer depends on your specific situation.

For example if you have limited time/budget it may be better to go with something that's already available, like views slideshow, and keep as much of your budget as possible for other tasks.
However there might be some reason that option isn't ideal, like maybe the modules have lots of functionality you don't need and you want to code something more specific to your requirements.

Another possible issue might be that the existing module doesn't do something exactly the way you need it to, so then you have to decide whether you write a patch to modify that module or if you want to write custom code.

This question deals with pros and cons of using custom code instead of existing modules.