Only one of the answers (by @Aechirfin) so far took into account one of the underlying issues in your question – “how does Dash combine with certain speed modifications if you have already used up some of your movement during your turn?”
My answer coincides with his/hers (using different words) but I will attempt to be more inclusive of other elements of the question. I notice there have been iterations of the question so some aspects of the question may have changed since the previous answers were submitted.
Noting your comment:
“After seeing this Q/A on whether releasing a grappled creature
increases your available movement, I am wondering a more general
question.”
… I would just caution that in the Q&A which you linked the most upvoted answer is in my opinion more accurate than the accepted one.
With all that said:
Longstrider Question
“For example, if you have 30 speed and movement, and you use 10
movement and then longstrider is cast on you, do you now have 30
movement left or 20?”
Answer
Longstrider adds 10 feet to your movement and it doesn’t matter if you receive the benefit before moving or partway through. The addition grants you a total of 40 feet on your turn, so you have 30 feet left.
Longstrider plus Dash
If you use the Dash action, you gain an additional 40 feet of movement because
“the increase equals your speed after applying any modifiers” (DnD
Basic Rules Version 1.0, Chapter 9, page 75)
Ray of Frost Question
“If you have 30 speed and movement, and you use 10 movement and then
ray of frost is cast on you, do you now have 20 movement left or 10?”
Answer
The deduction of 10 feet from your available movement can occur before you move or during, in either case reducing your available movement to 20 feet, of which 10 is used up and 10 remaining.
If you have already moved more than 20 feet when Ray of Frost is cast, then your movement is used up. Your movement for the turn will exceed 20 feet in this case.
Ray of Frost plus Dash
If Ray of Frost is cast upon you before you move, you can move 20 feet and use the Dash action for 20 feet, totaling 40 feet.
If you have already moved during your turn, prior to the cast of Ray of Frost, you would be able to continue moving up to a maximum of 40 feet.
If you have already moved more than 40 feet, prior to the cast of Ray of Frost, then your movement for the turn is used up. Your movement for the turn will exceed 40 feet in this case.
Grappling Question
“But I am still unsure; how do changes to your speed which occur on
your own turn, such as ...releasing a grapple... affect your available
movement for that turn?”
Answer
(Aside: with respect, I don't think the accepted answer tackles this coherently, one of the other answers gets it wrong, and the other doesn't tackle it at all)
If you "release a grapple" (meaning presumably: released someone from a grapple), this by itself doesn’t change your available movement. If your speed is 30 you can move 30 feet after releasing someone from a grapple.
If you mean “I moved some distance, then released someone from a grapple, then moved again,” then however much movement you have not used up yet, is now available to you upon releasing them from the grapple. The Dash action would add your full movement for additional distance.
Example: your speed is 30; you moved 10 feet holding someone in a grapple (which uses up 20 feet of movement), then you may now move an additional 10 feet, for total movement of 20 feet. If you take the Dash action you add another 30 feet for a total of 50 feet.