First I tried compiling your example with \pdfcompresslevel=0 and I got
BT
/F51 9.9626 Tf 91.925 759.927 Td [(~~~~~~~~~)]TJ/F30 9.9626 Tf 47.074 0 Td [(hello)]TJ/F1 9.9626 Tf 164.51 -654.747 Td [(1)]TJ
ET
As you see, the PDF file contains the repeated tilde, but the font resource has the modified encoding and so this tilde will appear as something else to the PDF viewer.
I did something else, then: I changed also /i into /nbspace and modified your example file into
\pdfcompresslevel=0
\pdfmapline{=rm-lmtt10 LMMono10-Regular " enclmrmtt ReEncodeFont " <lm-rmtt-mod.enc <lmtt10.pfb}
\font\myfont=rm-lmtt10
\def\myspace{{\myfont\char`~}}
{\obeyspaces\global\def {\myspace}}
\font\tentt=cmtt10
\tentt
\obeyspaces
hello
\def\myspace{{\myfont\char`i}}%
hello
\bye
(note that lm-rmtt-mod.enc is the modified .enc file, because I didn't want to tamper with default files). Here's what I get in the PDF file
BT
/F51 9.9626 Tf 91.925 759.927 Td [(~~~~~~~~~)]TJ/F30 9.9626 Tf 47.074 0 Td [(hello)]TJ/F51 9.9626 Tf -47.074 -11.955 Td [(iiiiiiiii)]TJ/F30 9.9626 Tf 47.074 0 Td [(hello)]TJ/F1 9.9626 Tf 164.51 -642.792 Td [(1)]TJ
ET
Here's what I see when I select all the text in Adobe Reader

which shows all spaces are “seen”.
If I do the same “select all” operation on Skim (an Apple PDFKit based previewer) I see instead

No spaces are copied. Therefore, the possibility of copying the spaces depends on the previewer.
Note however that, if I perform “copy” from Adobe Reader on the top line and then paste in an editor window, I get

What's “seen” are spaces, but the underlying text still has tildes.
.tfmfiles. The only type1 font files they use are the.pfb(or.pfafiles which do not contain any metrics. The metrics are contained in the.afm(or.pfmfiles but neither TeX nor pdfTeX uses those. When you create font support files, you use those files to create the.tfmfiles, along with other information. (Or, for pdfTeX, you can also create them from.ttffiles for use with truetype fonts.) – cfr Dec 24 '15 at 02:32/nbspace? This character is not in .tfm at all. – Igor Liferenko Dec 24 '15 at 02:43\newdimen\tempadimen \advance\tempadimen by 10pt?? – cfr Dec 24 '15 at 02:46\ \ \ \ \ \ \ \ \ hello, instead ofhello, as it would by default. Sorry, I do not know how to format spaces properly so that they will not disappear – Igor Liferenko Dec 24 '15 at 03:02\myfont– Igor Liferenko Dec 24 '15 at 03:06\ \ \and notin your source.texdocument? – cfr Dec 24 '15 at 03:15h. However, this is probably dependent on the PDF viewer. I think they likely deal differently with spaces. – cfr Dec 24 '15 at 03:18.texdocument. the backslashes are for the forum markup – Igor Liferenko Dec 24 '15 at 03:19atrilviewer it works correctly. – Igor Liferenko Dec 24 '15 at 03:33