As a player and a DM, I stick to a "Rule of Three"
As a player, I will not ask more than three questions (unless we're getting somwhere).
IE: If I ask them "Why are you here." and the NPC spits on my boot, I've got 2 more shorts before I'm no longer interested.
If I ask them "Why are you here." and they start spewing info, I will continue.
As a DM the NPC knows three important things. They may not be terribly important things but after they've divulged it I will freely inform the players "He really has nothing more to tell you." Or "You get the impression he's told you everything he knows."
-If the players refuse to discontinue engaging the NPC, I will pause the game and tell them straight up that this guy is done. I have no interest in wasting my time or everyone else's.
Similarly, I don't like to waste time haggling with shopkeeps and guards and stuff like that. Major NPCs may have more information, but they're not going to sit there and play 20 questions with the party if they have the option not to. Even then they will typically answer 3 questions, or provide 3 pieces of information before they have something else to do.
I wouldn't do anything about spell management. The only solutions here are:
A: the rest of the group tells them tough luck and pushes on.
B: the DM tells the group that a long rest is impossible here (remember you only get one per 24 hours and you need to be in a safe place).
-That's pretty much it. You can't MAKE them better at managing their spells.
I think you're overthinking the last part. The player did something silly and dumb and the guard let the player off with a finger-wagging. If the player isn't going to do it again, then it sounds like the situation is solved. I don't know how you may have run it differently, but I personally don't see the need for any kind of alternate resolution, what, the guard give him a beating? Arrest him too? Seems like an awful side-track for something very minor.
Some things are worth penalizing failure. Some things really aren't.
Like the Rule of Three -- definitely sticking that into my bag.
With regards to that last part... I guess it needs a little more context. When we came into the city, the City Guard gave us the third degree because they don't trust adventurers -- they always make a bunch of trouble. I mean there was a whole 'What are you doing here? How long are you going to be here?' scenario where it was clear the City Guard wanted to make sure that we weren't going to do anything to disturb the relative peace of the town.
This has basically never happened in any game I've played before, so I took the fact the guards were basically playing border patrol a serious indication we'd better be on our best behavior, or else we'd be in deep




So I was pretty surprised, less than a half hour of them giving us the third degree and the accompanying speeches about expected behavior, they were just 'whatevs' when the player attempted to steal from the dude they were hauling off.
I just didn't understand why the DM would place so much emphasis on the guard expecting us to be Bright Upstanding Visitors, then not really have any repercussions for Doing The Exact Opposite Thing twenty minutes later.
So I guess here, it's not necessarily the stealing -- but the stealing after the DM's gone out of their way to emphasize that we shouldn't make trouble here, and then we do. In situations where the DM clearly lays out 'hey guys, probably not a good idea to do dumb stuff here', I think there should be repercussions when they do it anyway. Most of our DMs go the "Are you suuuuure?" route, and that's generally effective, but man, sometimes people power right through.