You need an attorney ASAP and to stop discussing facts of the case on the internet. If you can't afford an attorney apply to the public defenders office for one.
You don't have to directly participate in the offense to be guilty as a party to the crime. You can be convicted if you aid and abet (assist, or be ready and willing to assist the person who actually does the deed) or by being part of a conspiracy to commit the offense. In your original post in this public forum you not only put yourself at the scene of the crime with knowledge of what your friend had done, but also admit to obstructing and illegal drug use. Stop posting, don't e-mail, tweet, or post on facebook regarding these events, and take steps to speak confidentially with your own attorney as soon possible. Burglary is a class F felony, punishable by a 12.5 year bifurcated prison sentence (up to 7.5 years in prison followed by up to 5 more years of extended supervison) and/or a fine of up to $25K.
This answer is provided for general information only. No legal advice can be given without a consult as to the specifics of the case.
Unfortunately, the situation you describe won't get solved by posting on this website. Felonies are serious -- potentially life-wrecking -- and you need an attorney. Hire someone if you can. If you cannot, that is why the public defender system exists.
My answer to your question is based on the facts that you provide in your question. Additional factual details about your situation could change my answer completely. The law in inherently uncertain and always subject to change.