I haven't played with this in quite awhile but in earlier versions of x-cart if you gave a product a price of $0.00 it would display "Call for Price". I can't remember if it still displayed the "add to cart" button or not (I don't think it should).
Anyway, you should be able to use the "price = $0.00" part of the code to display the "ask a question about this product" link in the product details using a if/else routine.
http://forum.x-cart.com/showthread.php?t=61432 discusses hiding the "add to cart" button.