First, you need to know that the hint is writen within the walls of the "prison".
Is a calculation you must solve to get the code.
You can read in the walls 6T . 7 and + 3.
Since you can read in the walls 6T . 7 and + 3. The . means times (in maths). Hence the writen message in the wall means 60 (6 T) times (.) 7 plus (+) 3. So 60 x 7 = 420. 420 + 3 = 423. The code is 423.
You need to use the tripping on air trick (shown in "Square One 2 and 3" by @vince) a couple of times and the trick shown first in "3x2 .1" by @Muslim.Arrizy.
Its quite simply but tricky. If you roll the wheel quite fast anti clock-wise once B is on top of it he will hit the win block. Although this move is quite tricky I have been able to win this level 10 consecutive times without a miss, so once you get the "feel" for it it is pretty stable.
Below you can find the same level with an alternative ending, in case you feel the original one is too hard.
Place B on top of the wheel. Roll it to the left. now make B step toward the stone block, while you do this rapidly move the wheel, this will place B on the win block.