Can I dig up next to my foundation to add height below my deck for storage?
You packed a lot of info into that question. Maybe break it into a couple of questions.  Regardless, the main question is about the excavation next to the foundation. I can't say for sure if that is a code violation in your area of Mass. I will say that in the Northeast, it is important to bury at least 4 feet of foundation or footings into the earth to prevent movement from frost. Depending where you are in Mass, the frost line probably runs from 2 to 4 feet below grade. The other problem with having a well entrance to a basement is the introduction of water, or the buildup of snow and ice in the well. I seriously doubt any permit was pulled for such a modification. Had this reduction in the frost wall depth been done at the time of a building inspection, I think it would have been frowned upon. usually extra depth of the frost wall and some type of drainage would be recommended.