I just found a possible work-around for the original question. It isn't elegant, but it may work.
In each of your section headings (ie, in the text, which are then used to generate the TOC automatically), add a tab and the page number. You have to type in the page number manually, and I'm pretty sure it doesn't pay to get too fancy with placement, adjusting tab stops, etc.
Now, if you refresh the TOC, you get the page number separated from the heading by a tab. (When I tried to adjust the tab stops in the TOC, I got various errors.)
If you don't want the page numbers to appear next to the headings in the body of the document, highlight them there and change the text color to the background color of the document (usually white). The numbers are still there, and will still show up in the TOC, but you can't see them elsewhere.
Unfortunately, the page numbers won't flow as you edit the document, so do this just before final publication.
Again, not elegant -- not in appearance or in process -- but if you must have physical page numbers in a printed document, it should do the trick.
Best Answer
Short answer
The "Publish to the web" feature of Google Documents doesn't include an option to add the link to edit the source document so one of the several ways to add the link like Google Apps Script and Google Documents add-on, Google Sites Gadget, JavaScript, etc. should be used.
Extended answer
Since the URL to edit a document has the file ID than the published to the web URL there are lot of ways to add the a link to edit the document at the bottom.
URL of a published to the web Google Document:
https://docs.google.com/document/d/1ZyU97pNm0wDtOziWKnToUnjtAZarpnny_8eohF8-_F0/pub
URL given by the Share feature: https://docs.google.com/document/d/1ZyU97pNm0wDtOziWKnToUnjtAZarpnny_8eohF8-_F0/edit?usp=sharing
URL given by the Google Drive get a link feature and getUrl() method:
https://docs.google.com/open?id=1ZyU97pNm0wDtOziWKnToUnjtAZarpnny_8eohF8-_F0
File ID
Considering the above, in certain scenarios could be easier to add the link manually than to automate this task.
Example
The following Google Apps Script snippet adds the URL of the document at the end of it's body.
The above is the same than copying the URL of the document and insert an hyperlink at the end of the document.
References