You're overthinking this. If you're close to leveling up just use all your energy. Then use your mana to fill in the gap. If the gap is too big for mana: harvest a crop, buy a fruit basket, or use an energy packet. It's just a game you don't need to conserve everything.