If you are taking the Red Hook ferry, the taxi to the ferry is a good 20 minutes and then the ferry ride is about half an hour. Once you are at St. Johns, its a short, may-be 10 minute taxi ride to Trunk Bay. The ferry's run every hour, so make sure to check that schedule. Yes, it does involve some time, but well worth it. There are also taxi's at trunk bay waiting to take you back to the ferry. Here is a link to the ferry schedule:
exactly what Donna said. There are plenty of taxis waiting at the pier when you dock in St. Thomas. Its a good 20 minutes with no traffic, figure on 30 minutes to Red Hook Harbor. The ferrys leave every hour on the hour so plan accordingly. The ferry ride over to Cruz Bay takes a good half-hour, once you dock, its a short walk down the pier where the taxis are. They are open-air taxis, nothing fancy. The ride to the beaches takes about 10 minutes, but the scenery is breathtaking, especially at the scenic overlook. Taxis will be plentiful for your return trip. Just budget your time, you don't want to be waiting at the pier for an hour for the next ferry.
May I suggest an alternative? Two minutes by cab past the RedHook ferry terminal is Saphire Bay resort and beach. The beach is public and there are adequate public facilities, bar , restaurant, convenience store , bathrooms, outdoor shower, cab stand, chair and water "toy" rentals etc.
The beach is beautiful, walk in snorkelling is great (as good as most on St John , better than Trunk Bay). While others are still waiting for the ferry and still have a cab ride after that (and have to repeat it on the way back) you will be on the beach and in the water snorkelling.
also don't forget about coki beach on st.thomas. it's about a 20 minute
ride there and there's tons of fish to see and you can walk right in
the water. also plenty of food and drinks available with lockers and
showers. this is my favorite place to snorkel as the fish are always
there because it's right next to coral world and the fish know they
are always going to be fed. whatever you do enjoy it.