Ah, yes, that is a harder nut to crack. You would need to bring the type variables in type patterns into scope before typechecking. See the code for tc_fam_ty_pats in TcTyClsDecls for how this is done normally, but it's rather involved.
As for querying existing structures, you may have a hard time. The problem is that types are handled differently from terms. Terms are typechecked and converted from HsExpr Name to HsExpr Id. The HsExpr Id has been typechecked and thus has stable type information. But, because it's a variant of HsExpr, it still has location information. HsExpr Id is then desugared into CoreExpr, which has no location information.
Types, on the other hand, are checked and desugared simultaneously. This is necessary because typechecking needs to be able to compare types, and we wouldn't want to try to compare HsTypes for equality. So, instead of going through an HsType Id formation, the typechecker goes straight from HsType Name to Type (the Core type type). `Type`, of course, has no location information. So, you won't be able to query by location.
But, I just thought of a way out: type family instances are compiled into CoAxioms, which *do* store location information. The list of CoAxioms should be available from the ModuleInfo via modInfoTyThings. Or, you can get a CoAxiom out of a FamInst if you have that handy. An open type family instance's CoAxiom will have one branch. Then, you can look at the tyvars (cab_tvs) and types (cab_lhs) to triangulate to the bit that you want. It's quite possible that the `Name`s of the tyvars have the location you're looking for. Be careful, because the list of tyvars includes kind variables here, which are omitted in the source. isKindVar should be helpful in filtering these out.
I hope this helps!
Richard