ToggleTalentFrame() will show the frame.
I'm not sure you can go straight to the Pet Talent Frame,
but checking for PlayerTalentFrameType2:IsVisible()
should allow you to select the proper tab with
PanelTemplates_SetTab(PlayerTalentFrame, pettab)
(not sure what number 'pettab' would be, but little experimentation should find out)