You can't interrupt playing one card to play another. So you play Shanty Town, you get +2 Actions, you reveal your hand and since there's another Action card there you don't get to draw. Then, once all of that has finished resolving, you've got 2 Actions in your pool, so you can spend one to play that card.
There are some cards that specifically say that you get to play another card as part of resolving them, including Throne Room, Golem, and Herald (as well as Black Market and Storyteller which let you play Treasure cards when you play them). In those cases, you play the main card, let's say Throne Room. It tells you to pick a card in hand and play it twice, so you do that. Once you've finished playing that card twice, you also finish resolving the Throne Room. For example:
Play Throne Room
Select Shanty Town from hand
Play Shanty Town (first play)
+2 Actions
Reveal hand
Conditionally draw cards
Done playing Shanty Town
Play Shanty Town (second play)
+2 Actions
Reveal hand
Conditionally draw cards
Done playing Shanty Town
Done playing Throne Room
At the end of which, you are up 3 Actions and 0-6 cards. Alternatively, you might have something like (see below for card text):
Play Procession
Select Throne Room from hand
Play Throne Room (first play)
Select Storyteller from hand
Play Storyteller (first play)
+1 Action
+1 Coin
Select 3xCopper from hand
Play Copper from hand
+1 Coin
Play Copper from hand
+1 Coin
Play Copper from hand
+1 Coin
Spend all coins (4) and draw that many cards
Done playing Storyteller
Play Storyteller (second play)
+1 Action
+1 Coin
Select Diadem from hand
+2 Coins
+1 Coin per unused Action (2)
Spend all coins (4) and draw that many cards
Done playing Storyteller
Done playing Throne Room
Play Throne Room (second play)
Select nothing from hand
Done playing Throne Room
Trash Throne Room
Gain Storyteller
Done playing Procession
Where Procession = "You may play an action card from your hand twice. Trash it. Gain an Action card costing exactly $1 more than it.You may play an action card from your hand twice. Trash it. Gain an Action card costing exactly $1 more than it.", Storyteller = "+1 Action, +$1; Play up to 3 Treasures from your hand. Pay all of your $; +1 Card per $ paid.", and Diadem = "$2; When you play this, +$1 per unused Action you have (Action, not Action card)."
Note how the coin that Storyteller naturally gives you comes first, and is then turned into drawing a card draw by the time it finishes resolving. Similarly, the Actions you get from the two Storyteller plays give you coin for Diadem, but don't let you play more Action cards until the whole chain is completely resolved. And trashing the Throne Room and gaining a new card due to Procession happens right at the end, so you won't draw the new Storyteller as part of drawing cards from the one you picked to Throne Room.