I know this sounds like the most obvious answer, but it may just be the ugly lag monster rearing it's head. You wouldn't get lag on single player, and it does vary depending on your connection and the server. Even if you have brilliant connection, the server might not, or have certain factors increasing lag (bulky scripts, too much happening in an area). Does this happen for all servers you play on? Is anyone else on the servers suffering the sme problem?
I admit, 10-40 secs would be pretty nasty lag. The only suggestion I have is try out a few servers, see if it's universal. Also check to see what your computer is doing while playing- Single player might not take as much effort to run as multiplayer, so if your computer is struggling that might explain these 'lag-like' pauses. If another program is running while your playing, that you don't need running, then consider exiting or disabling it using task manager.
Does there seem to be any pattern, other timing, that provokes this? Certain actions your character, or another character does? Other then that, I'm unsure my friend.