Have a look at what we did in our pattern-match question type: http://www.open.edu/openlearnworks/mod/oucontent/view.php?id=52747§ion=2.2.1
Near the top of that page, there is a box "Placing the response box"
If you put either _________ or ___20x1___ in the question text, then you get a standard text input of the given length at that point.
If you put something like ___20x5___ then you get a textarea of that size (20 chars wide, 3 rows high).
Perhaps you could adopt the same convention.