sorry, misinterpreted what was going on in the video.
he is using OpenGL to draw the text in his custom plugin.
Look into the M3DView documentation in the API docs. you have to do the conversion form C++ to python coding.
and i am sure if you dig through some of the sample scripted plugins in the devkit in your maya install you will find some examples.
http://forums.cgsociety.org/archive/index.php/t-136112.html
here is a link to a simple example of getting some data drawing to the viewport, the given code is only the draw part of a custom plugin node.
but if all you need is a simple text display for an object i would suggest using the annotation node route.