I strongly believe it's not a good idea.
Why not.
providing you ensure that the recursive function (you were planning on coding it as a function I assume) cannot go on for ever then I see no problem with it.
It did use a similar function once albeit it a quite limited fashion and it seemed to work ok.
I would use a function with 2 parameters
recursive_menu($parent_id,$offset_level=0)
and would start it off with
recursive_menu(0) on the assumption that the highest menu level is zero
the function would loop through a list of all menu entries which have a parent level of $parent_id and for each I would print it's menu line and then call the function again with
recursive_menu($current_id,$offset_level +1)
I would build in a check that prevent the function from continuing if the offset_level if greater than say 20.
The offset_level therfore has two uses, one is to simply keep a count of the indenting for showing the menu items and the other is to prevent an infinite loop.
Hope that this helps.