When you place an order coins are not taken from you. They remain in your account until the order executes, i.e. until there is a trade. Note: You will see the balance move from "available" to "in orders", but that is simply a visual aid and there are no real movements in your account.
If you cancel a pending order there is nothing to be returned because nothing was taken in the first place. If you cancel a partially executed order then the executed portion is already gone and cannot be returned.