The simple question here is...did you have that much gold on you at the time? The merchant script/conversation checks to see if you have enough gold before giving you the option to actually buy. If you didn't have the 17,500 GPs to pay for the horse, then you won't get the option to buy.