Pinyin is never an established written language. We have a standard, 《汉语拼音正词法基本规则》, but no one actually bothered to learn it. In short, it treats pinyin as if it is a romanized language. You follow what's correct in English. However, 成语 is so special that it has individual chapters for it:
结构上可以分为两个双音节的,中间加连接号。 例如: fēnɡpínɡ-lànɡjìnɡ(风平浪静) àizēnɡ-fēnmínɡ(爱憎分明) shuǐdào-qúchénɡ(水到渠成)
yánɡyánɡ-dàɡuān(洋洋大观) pínɡfēn-qiūsè(平分秋色) ɡuānɡmínɡ-lěiluò(光明磊落)
diānsān-dǎosì(颠三倒四)
结构上不能分为两个双音节的,全部连写。 例如: cénɡchūbùqiónɡ(层出不穷)
bùyìlèhū(不亦乐乎) zǒnɡ’éryánzhī(总而言之) àimònénɡzhù(爱莫能助) yīyīdàishuǐ(一衣带水)
According to this, we may need to add hyphens inbetween 徐娘半老 and 杞人忧天 when they are written as pinyin.
Then it also says this about property nouns:
专有名词成分与普通名词成分连写在一起的,是一般语词或视为视为一般语词的,首字母小写。 例如: ɡuǎnɡɡān(广柑) jīnɡjù(京剧)
ējiāo(阿胶) zhōnɡshānfú(中山服) chuānxiōnɡ(川芎) zànɡqīnɡɡuǒ(藏青果)
zhāoqín-mùchǔ(朝秦暮楚) qiánlǘzhījì(黔驴之技)
If the text is confusing you, you can look at the last two examples. When a property noun is part of a 成语, it doesn't need to be capitalized.
But then it also has this to say about 成语:
辞书注音需要显示成语及其他词语内部结构时,可按词或语素分写。 例如: chīrén shuō mènɡ(痴人说梦) wèi yǔ
chóumóu(未雨绸缪) shǒu kǒu rú pínɡ(守口如瓶) Hēnɡ-Hā èr jiànɡ(哼哈二将)
This is a suggestion specific to dictionaries, you separate them and properly capitalize the property nouns, in order to display the internal structure of a 成语.
So to answer your question: If you aren't writing a dictionary, you should do this:
- 徐娘半老 xúniáng-bànlǎo
- 杞人忧天 qǐrén-yōutiān