Hey, The last time I tested this dupe was March and im about to make a nub character and try it in a minute.
1. Talk to your trainer (Can be professions or class)
2. Open up your chat window and type /logout (DONT PRESS ENTER)
3. As you buy the skill, press enter to logout*
4. Log back in and you should still have your money
* - You need to press them at EXACTLY the same time AND you may need some lag (Not sure if its needed but it was laggy whilst I did it)
You can use NetLimiter for restricting bandwidth and getting a nice high ping.
***EDIT***
I just tested it and it didnt work. I only did it with 2 spells so if anyone else could try it would be helpful?