The magic cape has an internal cooldown counter (RAM address 7E02E2) that has the following logic:
When deactivating the cape, Link will enter a "cape poof state" for 24 frames. Link can still use his sword or Y items during this time, and can charge dashes, but cannot walk normally using the d-pad.
More specifically, this appears to be governed (or at least correlated with) the RAM values at 7E03B5 (walking) and 7E03B4 (dashing), which decrement from 7 to 0 before rolling back to 7, and the RAM value at 7E083D, which cycles between 3 values.
Cape poof state has slightly different properties if the cape is deactivated by pressing Y/running out of magic versus quickswapping/menuing to a different item -- in most cases, the latter is preferred.
(The boots are required to use this technique)
If poof state is entered by switching away from the cape (via quickswap or menu), then tapping A while holding a direction during poof state will cause Link to walk in that direction for the remainder of poof state. This can be used to effectively bypass the normal poof state movement restriction. Link will only start moving once the A button is released, so you'll normally want to tap it as briefly as possible.
Note that Link will be unable to change his walk direction for the remainder of poof state unless A is tapped again.
Cancelling a dash during poof state will put Link into a poof walk in the direction of the dash, meaning Link will forcibly walk in that direction for the remainder of poof state. To avoid this (usually unwanted) behavior, a poof walk can be started in a different direction (by tapping A while holding a direction), allowing Link to change directions immediately instead of waiting for poof state to end.