To avoid getting grabbed, either go extra far in or extra far out on an aerial approach to avoid a shield grab, and try to do the aerial as low as possible. Overshoot approaches to beat dash dance grab, wall Marth out to beat an approaching grab (or potentiall run through him), shine or do a multi-hit attack (i.e. drill) to beat CC grab (of course they can CC and SDI out, in which case you're screwed). Or just to the best thing and grab him yourself.
Dtilt can potentially trip up a lot of Marth's trying to move around too much to get the grab, but it's terrible on shield.
To avoid getting comboed into grab, CC can get you out on the ground, and DI out works vs any forward oriented hitbox (don't DI fsmash or ftilt out). SDI up or down can help vs utilt or uair->grab, but not if you were on the ground.
DIing utilt extra far into Marth (tipper start up) should allow you to escape a direct regrab, but can leave you vulnerable to a tech-chase. SDIing a uair away and down with respect to whatever side of Marth you're on can help there too.
Generally, forcing Marth to dash backwards is preferable to having him dash forward if the timing is tight. Slight DI behind is very useful at lower percents, and practice jump out of aerial shine into immediate air dodge down to maximize the usefulness of shining out.
The angle uthrow launches you is slightly behind Marth, but you're thrown from a point slightly in front of him, so just think about that a little (remember, the lower the angle you achieve from DI, the quicker you reach the ground, and the further you're launched from him horizontally, the more he has to move). You want to measure the time it takes for you to reach the ground (or get out of hitstun if you're SDIing up) vs the time it takes Marth to get into position where a grab hitbox would connect (if possible).