Subs are also made and sold on the open market. For $40,000 you can get a "Sport/Resort Sub" and not even have to wear scuba gear. The ones on that link can carry up to a 600lb payload, operate at 130 ft and cruise at 5 knots. 130 ft isn't particularly deep either. It's the limit of ordinary recreational diving.
The beauty of something like this, the way I see it, the equipment (at least the diving part of it) is readily available world wide. The training is even more readily available and there are hundreds of dive schools already set up in Muslim countries- no need to send your man to a dangerous place. Turkey, Maldives, Egypt, Zanzibar--- all places where you would find a lot of Muslim divers or train some without attracting notice. There are many highly qualified Muslim divers in the Maldives and with thousands of islands it would make a perfect place to hide a few operatives.
You might call 'em stupid- but that stupidity killed thousands on 9/11. It might be blind, fantatical, suicidal devotion to something we don't understand- but it is effective.
I don't think rigging up a pressure activated bomb to the nose of one of these propulsion vehicles would be that difficult. You can get a range of a couple of miles out of 'em easily. You could drop your man out of site from the harbor and be well on your way away before he ever reached his target. A top-side sentry on the boat would probably never even spot the incoming suicide bomber. You cause major damage to a large vessel in a harbor mouth, even without killing a lot of people you could cause a hell of a lot of economic damage by shutting down the port.
I think it's something we need to think about. Al Qaeda has the assets to make this happen. Hell, I practically have the assets to make it happen. This is quite a simple feat and they have already shown repeatedly their willingness to die.
Suppose that the incoming bomber was spotted. Could we defend against it and how (in a harbor)? I don't think that rifle or machine gun fire would be of much use and explosives wouldn't be as easily deployed in a hurry. I admit that I know nothing about big boats and defenses.