The abstract knowledge you pick up (such as algorithms, you already refer to that) will help though, since it will allow you to build relatively complex stuff where 'cut-and-paste' types will have a disadvantage competing against you.
Open source is great way to advertise your skills, but only if you want to be re-hired somewhere, is that your intention or do you plan to become independent ?
The last item on your list sounds like the best bet in the shorter term. But maybe first you should exchange your job that you hate for a nicer one to get you out of the frame of mind you're in and in to a more healthy one.
Then from a position of strength you can make your decisions, usually that works better (at least, it does for me).
Good luck!