In this expression, this refers to the VesselModule or PartModule or MonoBehaviour which actually contains it. The problem with this approach is that, firstly, a MonoBehaviour does not have a vessel; and secondly, that the expression does not refer to the active vessel (as specified by your question) but instead to the vessel to which a given module is attached. In other words, the expression will "follow" the vessel with the part, and not the player's focus.
Apart from that—I can't seem to find a Vessel.name in the 1.10 API docs, so I'm not sure if it's valid. After reading the API docs a bit more, I'd suggest using GetDisplayName() instead of either name or (as I suggested earlier) GetName(), since in some circumstances GetName() may return a localization token—this is almost certainly not what you're after if you're asking for a vessel's name.
There are a few "best practices" violations in this snippet, though as far as I know this is (approximately) the best way to do this kind of thing. I haven't worked with resources for a while, though, so I'm not an authority on that part.
Anyways: Thread.Sleep() is not the correct way to do this, for several reasons—not the least of these being that Thread.Sleep() operates in real time, not game time. (If you've ever seen the clock turn red, you know how different these two can be.) Better to put this in a FixedUpdate() (of one of those MonoBehaviour or Part/VesselModules mentioned earlier), and use Time.fixedDeltaTime to get the length of the last physics frame. Note also that we're not using Update() and deltaTime because we expect changes to resources to happen in lockstep with the physics, not the rendering.
Rather than getting a read on the resource totals, and then waiting, and then getting another one, you can instead do the following:
1. Read the resource totals; place this in currentAmount.
2. Subtract lastAmount from this, and multiply divide by Time.fixedDeltaTime. This is the rate: the change multiplied by the time it took to make that change.
3. Put currentAmount in lastAmount to use next frame.