I don't think its a case of Smart versus Stupid. Everyone on this planet makes decisions that are probably not the best.
You have lost a friend and your wife does not seem to be supportive and that isn't helping matters. One of the most important things for a person with Bipolar is sleep. If your sleep if lousy you will not be able to function and make good decisions.
Get in touch with your Pdoc asap to address the insomnia.
I hope things settle down and you are able to deal with whatever you need to with a clear head.