What exactly is an offensive position and a defensive position. Think of it in terms of balance and comfort. When you are well balanced and have the ball at a height that is comfortable for your stroke you are in an offensive position. Now you must get more specific. Tailor your exact shot according to the purpose or goal you have in hitting that shot.
Every shot hit on a tennis court has one of two purposes.
To win the point outright with that shot or to better your position. The majority of shots are hit to better your position. Approach shots are a good example of this principle. Many players when coming to the net overhit their approach shot, often making an unforced error before they even get a chance to volley. By trying to win the point outright with the approach shot an unnecessary risk was taken.